/chef-solr/Rakefile

http://github.com/opscode/chef · Rakefile · 65 lines · 36 code · 11 blank · 18 comment · 1 complexity · ea4982280f43d2e385e8f584043c09d2 MD5 · raw file

  1. #
  2. # Author:: Adam Jacob (<adam@opscode.com>)
  3. # Author:: Daniel DeLeo (<dan@opscode.com>)
  4. # Copyright:: Copyright (c) 2008, 2010 Opscode, Inc.
  5. # License:: Apache License, Version 2.0
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. require File.dirname(__FILE__) + '/lib/chef/solr/version'
  20. require 'rubygems'
  21. require 'rake'
  22. require 'rubygems/package_task'
  23. spec = eval(File.read(File.dirname(__FILE__) + "/chef-solr.gemspec"))
  24. desc "Create solr archives"
  25. task :tar_solr do
  26. %w{solr-home solr-jetty}.each do |tar|
  27. Dir.chdir(File.dirname(__FILE__) + "/solr/#{tar}") { sh "tar cvzf ../#{tar}.tar.gz *" }
  28. end
  29. end
  30. task :gem => :tar_solr
  31. Gem::PackageTask.new(spec) do |pkg|
  32. pkg.gem_spec = spec
  33. end
  34. desc "Install the gem"
  35. task :install => :package do
  36. sh %{gem install pkg/chef-solr-#{Chef::Solr::VERSION} --no-rdoc --no-ri}
  37. end
  38. desc "Uninstall the gem"
  39. task :uninstall do
  40. sh %{gem uninstall chef-solr -x -v #{Chef::Solr::VERSION} }
  41. end
  42. require 'rdoc/task'
  43. RDoc::Task.new do |rdoc|
  44. if File.exist?('VERSION.yml')
  45. config = YAML.load(File.read('VERSION.yml'))
  46. version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
  47. else
  48. version = Chef::Solr::VERSION
  49. end
  50. rdoc.rdoc_dir = 'rdoc'
  51. rdoc.title = "chef-solr #{version}"
  52. rdoc.rdoc_files.include('README*')
  53. rdoc.rdoc_files.include('lib/**/*.rb')
  54. end