Permalink
Browse files

Rake package task now builds a gem with a Cruise executable that runs…

… the app on *nix. Some Rakefile cleanup.
  • Loading branch information...
1 parent 383cb31 commit c598ddd78e8e0a916eadeb65505e4e9d6a547137 @bguthrie committed Jun 21, 2011
Showing with 45 additions and 40 deletions.
  1. +1 −0 .gitignore
  2. +2 −0 Gemfile
  3. +1 −0 Gemfile.lock
  4. +0 −12 Rakefile
  5. +7 −4 cruisecontrolrb.gemspec
  6. +34 −9 lib/tasks/package.rake
  7. +0 −15 lib/tasks/release.rake
  8. BIN vendor/cache/bundler-1.0.10.gem
View
1 .gitignore
@@ -20,6 +20,7 @@ dist/
vendor/plugins/rails_upgrade
vendor/ruby/
vendor/jruby/
+vendor/bundle
server_jar/target/
config/ccrb.properties
View
2 Gemfile
@@ -9,6 +9,8 @@ gem "api_cache", "0.2.0"
gem "xml-simple", '1.0.16', :require => 'xmlsimple'
gem "rake", "0.8.7"
gem "jquery-rails", '1.0.9'
+gem "rake", "0.8.7"
+gem "abstract", "1.0.0"
group :development do
gem "rcov", '0.9.9'
View
1 Gemfile.lock
@@ -84,6 +84,7 @@ PLATFORMS
x86-mingw32
DEPENDENCIES
+ abstract (= 1.0.0)
api_cache (= 0.2.0)
httparty (= 0.6.1)
jquery-rails (= 1.0.9)
View
12 Rakefile
@@ -3,16 +3,4 @@
require File.expand_path('../config/application', __FILE__)
-require 'rake'
-require 'rake/rdoctask'
-
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-
CruiseControl::Application.load_tasks
-
-PKG_NAME = 'cruisecontrol'
-PKG_VERSION = CruiseControl::VERSION::STRING
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-
-RELEASE_NAME = "REL #{PKG_VERSION}"
View
11 cruisecontrolrb.gemspec
@@ -1,8 +1,8 @@
require 'rake'
require 'pathname'
-require Pathname.new(__FILE__).expand_path.dirname.join('lib', 'cruise_control', 'version')
+require File.expand_path('../config/application', __FILE__)
-Gem::Specification.new do |s|
+GEMSPEC = Gem::Specification.new do |s|
s.name = 'cruisecontrolrb'
s.summary = 'CruiseControl for Ruby. Keep it simple.'
s.version = CruiseControl::VERSION::STRING
@@ -15,9 +15,11 @@ Gem::Specification.new do |s|
s.email = 'cruisecontrolrb-developers@rubyforge.org'
s.homepage = 'http://cruisecontrolrb.thoughtworks.com'
s.has_rdoc = false
+ s.bindir = "."
+ s.executables << "cruise"
s.files = FileList[
- '[A-Z]*',
+ '[a-zA-Z0-9]*',
'app/**/*.rb',
'bin/**/*',
'config/**/*',
@@ -28,7 +30,8 @@ Gem::Specification.new do |s|
'script/**/*',
'server_jar/**/*',
'tasks/**/*',
- "vendor/#{RUBY_ENGINE}/**/*"
+ "vendor/bundle/**/*",
+ ".bundle/*"
]
s.test_files = FileList['test/**/*']
View
43 lib/tasks/package.rake
@@ -1,11 +1,36 @@
-Rake::PackageTask.new("cruisecontrolrb", CruiseControl::VERSION::STRING) do |p|
- p.need_tar = true
- p.need_zip = true
-
- p.package_files.include("**/**")
-
-
- %w(log/** tmp/** pkg/** vendor/jruby/** vendor/cache/** vendor/java/** server_jar/** vendor/**/cache/**).each do |f|
- p.package_files.exclude(f)
+load Rails.root.join("cruisecontrolrb.gemspec")
+
+task :package => ["package:gem"]
+
+namespace :package do
+ def gem_file
+ if gem_spec.platform == Gem::Platform::RUBY
+ "#{gem_spec.full_name}.gem"
+ else
+ "#{gem_spec.full_name}-#{gem_spec.platform}.gem"
+ end
+ end
+
+ def package_dir
+ "pkg"
+ end
+
+ def gem_spec
+ GEMSPEC
+ end
+
+ task :gem => :prepare do
+ Gem::Builder.new(gem_spec).build
+ verbose(true) { mv gem_file, "#{package_dir}/#{gem_file}" }
+ end
+
+ desc "Remove all existing packaged files."
+ task :clean do
+ verbose(true) { rm_f package_dir }
+ end
+
+ desc "Install all dependencies using Bundler's deployment mode."
+ task :prepare => :clean do
+ system "bundle install --deployment"
end
end
View
15 lib/tasks/release.rake
@@ -1,15 +0,0 @@
-desc "Publish the release files to RubyForge. May not work."
-task :release do
-#task :release => [ :package ] do
- require 'rubyforge'
-
- options = {"cookie_jar" => RubyForge::COOKIE_F}
- puts "Enter rubyforge password:"
- options["password"] = $stdin.gets.strip
- ruby_forge = RubyForge.new(File.dirname(__FILE__) + "/config/rubyforge.yml", options)
- ruby_forge.login
-
- files = %w( tgz zip ).collect {|ext| "pkg/#{PKG_FILE_NAME}.#{ext}"}
- puts "Releasing #{files.collect{|f| File.basename(f)}.join(", ")}..."
- ruby_forge.add_release(RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, *files)
-end
View
BIN vendor/cache/bundler-1.0.10.gem
Binary file not shown.

0 comments on commit c598ddd

Please sign in to comment.