Skip to content

Commit

Permalink
Rake package task now builds a gem with a Cruise executable that runs…
Browse files Browse the repository at this point in the history
… the app on *nix. Some Rakefile cleanup.
  • Loading branch information
bguthrie committed Jun 21, 2011
1 parent 383cb31 commit c598ddd
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ dist/
vendor/plugins/rails_upgrade vendor/plugins/rails_upgrade
vendor/ruby/ vendor/ruby/
vendor/jruby/ vendor/jruby/
vendor/bundle
server_jar/target/ server_jar/target/


config/ccrb.properties config/ccrb.properties
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -9,6 +9,8 @@ gem "api_cache", "0.2.0"
gem "xml-simple", '1.0.16', :require => 'xmlsimple' gem "xml-simple", '1.0.16', :require => 'xmlsimple'
gem "rake", "0.8.7" gem "rake", "0.8.7"
gem "jquery-rails", '1.0.9' gem "jquery-rails", '1.0.9'
gem "rake", "0.8.7"
gem "abstract", "1.0.0"


group :development do group :development do
gem "rcov", '0.9.9' gem "rcov", '0.9.9'
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Expand Up @@ -84,6 +84,7 @@ PLATFORMS
x86-mingw32 x86-mingw32


DEPENDENCIES DEPENDENCIES
abstract (= 1.0.0)
api_cache (= 0.2.0) api_cache (= 0.2.0)
httparty (= 0.6.1) httparty (= 0.6.1)
jquery-rails (= 1.0.9) jquery-rails (= 1.0.9)
Expand Down
12 changes: 0 additions & 12 deletions Rakefile
Expand Up @@ -3,16 +3,4 @@


require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)


require 'rake'
require 'rake/rdoctask'

require 'rake/packagetask'
require 'rake/gempackagetask'

CruiseControl::Application.load_tasks CruiseControl::Application.load_tasks

PKG_NAME = 'cruisecontrol'
PKG_VERSION = CruiseControl::VERSION::STRING
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"

RELEASE_NAME = "REL #{PKG_VERSION}"
11 changes: 7 additions & 4 deletions cruisecontrolrb.gemspec
@@ -1,8 +1,8 @@
require 'rake' require 'rake'
require 'pathname' 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.name = 'cruisecontrolrb'
s.summary = 'CruiseControl for Ruby. Keep it simple.' s.summary = 'CruiseControl for Ruby. Keep it simple.'
s.version = CruiseControl::VERSION::STRING s.version = CruiseControl::VERSION::STRING
Expand All @@ -15,9 +15,11 @@ Gem::Specification.new do |s|
s.email = 'cruisecontrolrb-developers@rubyforge.org' s.email = 'cruisecontrolrb-developers@rubyforge.org'
s.homepage = 'http://cruisecontrolrb.thoughtworks.com' s.homepage = 'http://cruisecontrolrb.thoughtworks.com'
s.has_rdoc = false s.has_rdoc = false
s.bindir = "."
s.executables << "cruise"


s.files = FileList[ s.files = FileList[
'[A-Z]*', '[a-zA-Z0-9]*',
'app/**/*.rb', 'app/**/*.rb',
'bin/**/*', 'bin/**/*',
'config/**/*', 'config/**/*',
Expand All @@ -28,7 +30,8 @@ Gem::Specification.new do |s|
'script/**/*', 'script/**/*',
'server_jar/**/*', 'server_jar/**/*',
'tasks/**/*', 'tasks/**/*',
"vendor/#{RUBY_ENGINE}/**/*" "vendor/bundle/**/*",
".bundle/*"
] ]


s.test_files = FileList['test/**/*'] s.test_files = FileList['test/**/*']
Expand Down
43 changes: 34 additions & 9 deletions lib/tasks/package.rake
@@ -1,11 +1,36 @@
Rake::PackageTask.new("cruisecontrolrb", CruiseControl::VERSION::STRING) do |p| load Rails.root.join("cruisecontrolrb.gemspec")
p.need_tar = true
p.need_zip = true task :package => ["package:gem"]


p.package_files.include("**/**") namespace :package do

def gem_file

if gem_spec.platform == Gem::Platform::RUBY
%w(log/** tmp/** pkg/** vendor/jruby/** vendor/cache/** vendor/java/** server_jar/** vendor/**/cache/**).each do |f| "#{gem_spec.full_name}.gem"
p.package_files.exclude(f) 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
end end
15 changes: 0 additions & 15 deletions lib/tasks/release.rake

This file was deleted.

Binary file removed vendor/cache/bundler-1.0.10.gem
Binary file not shown.

0 comments on commit c598ddd

Please sign in to comment.