Rakefile in vic-buildr-1.3.1 vs Rakefile in vic-buildr-1.3.3

- old
+ new

@@ -14,32 +14,23 @@ # the License. require 'rake/gempackagetask' -def spec(platform = nil) - @specs ||= {} - platform ||= RUBY_PLATFORM =~ /java/ ? 'java' : 'ruby' - @specs[platform] ||= begin - spec = Gem::Specification.load(File.join(File.dirname(__FILE__), 'buildr.gemspec')) - spec.platform = platform - if platform =~ /java/ - spec.add_dependency 'jruby-openssl', '0.2' - spec.add_dependency 'ci_reporter', '1.5.1' # must come after builder dependency - else - # Place first on the dependency list, otherwise AntWrap picks the latest RJB. - spec.dependencies.unshift Gem::Dependency.new('rjb', ['>=1.1.0', '<= 1.1.2']) - end - spec - end +def spec(platform = RUBY_PLATFORM[/java/] || 'ruby') + @specs ||= ['ruby', 'java'].inject({}) { |hash, platform| + $platform = platform + hash.update(platform=>Gem::Specification.load('buildr.gemspec')) + } + @specs[platform] end desc 'Compile Java libraries used by Buildr' task 'compile' do puts 'Compiling Java libraries ...' - sh Config::CONFIG['ruby_install_name'], '-Ilib', '-Iaddon', 'bin/buildr', 'compile' + sh File.expand_path('_buildr'), '--buildfile=buildr.buildfile', 'compile' puts 'OK' end file Rake::GemPackageTask.new(spec).package_dir=>'compile' file Rake::GemPackageTask.new(spec).package_dir_path=>'compile' @@ -50,15 +41,22 @@ ENV['incubating'] = 'true' ENV['staging'] = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}" -task 'apache:license'=>spec.files -task('apache:license').prerequisites.exclude('doc/css/syntax.css') +task('apache:license').enhance FileList[spec.files].exclude('.class', '.png', '.jar', '.tif', '.textile', '.icns', + 'README', 'LICENSE', 'CHANGELOG', 'DISCLAIMER', 'NOTICE', 'etc/KEYS', 'etc/git-svn-authors') -task 'spec:check' do +task 'stage:check' do print 'Checking that we have JRuby, Scala and Groovy available ... ' fail 'Full testing requires JRuby!' unless which('jruby') fail 'Full testing requires Scala!' unless which('scala') fail 'Full testing requires Groovy!' unless which('groovy') puts 'OK' end + +task 'stage:check' do + # Dependency check for the other platform, i.e. if making a release with Ruby, + # run dependency checks with JRuby. (Also, good opportunity to upgrade other + # platform's dependencies) + sh RUBY_PLATFORM =~ /java/ ? 'ruby' : 'jruby', '-S', 'rake', 'setup dependency' +end \ No newline at end of file