Permalink
Browse files

Fix jruby-jars gem packaging rakefile for 1.4 release

  • Loading branch information...
1 parent 69fbfa3 commit 731d38dc5d786b44f77373812427b9a3de8bd350 @nicksieger nicksieger committed Nov 2, 2009
Showing with 32 additions and 26 deletions.
  1. +1 −0 .gitignore
  2. +3 −3 gem/Manifest.txt
  3. +28 −20 gem/Rakefile
  4. +0 −3 gem/lib/jruby-jars/version.rb
View
@@ -25,6 +25,7 @@ spec/ruby
test/rails
test/prawn
gem/lib/*.jar
+gem/lib/jruby-jars/version.rb
gem/pkg
*.orig
*.rej
View
@@ -1,7 +1,7 @@
History.txt
Manifest.txt
README.txt
-lib/jruby-jars/version.rb
lib/jruby-jars.rb
-lib/jruby-core-1.3.1.jar
-lib/jruby-stdlib-1.3.1.jar
+lib/jruby-jars/version.rb
+lib/jruby-core-1.4.0.jar
+lib/jruby-stdlib-1.4.0.jar
View
@@ -4,54 +4,62 @@ require 'rubygems'
require 'hoe'
task :default => :package
-task :package => :prepare
-directory "pkg/jruby-jars-#{JRUBY_VERSION}/lib"
+JRUBY_SRC_VERSION = IO.readlines("../default.build.properties").detect {|l| l =~ /^version\.jruby=(.*)/} && $1
file 'pkg/jruby-complete.jar' => "pkg" do
pkg_dir = File.expand_path('pkg')
- Dir.chdir('..') do
- sh "ant jar-complete -Ddest.lib.dir='#{pkg_dir}'"
- end
+ fail "Run `ant dist' first to create complete jar" unless File.exist?("../jruby-complete.jar")
+ cp "../jruby-complete.jar", pkg_dir
end
def core_files_and_dirs
FileList[*%w(builtin jruby org com jline jay jni YechtService.class)].select{|f| File.exist?(f) }
end
desc "Run to update jars and versions"
-task :update => ['pkg/jruby-complete.jar', "pkg/jruby-jars-#{JRUBY_VERSION}/lib"] do
+task :update => 'pkg/jruby-complete.jar' do
rm_f 'lib/*.jar'
%w(pkg/jruby-complete pkg/jruby-core).each {|d| rm_rf d; mkdir_p d }
Dir.chdir("pkg/jruby-complete") do
sh "jar xf ../jruby-complete.jar"
mv core_files_and_dirs, "../jruby-core"
end
- sh "jar cfm pkg/jruby-jars-#{JRUBY_VERSION}/lib/jruby-core-#{JRUBY_VERSION}.jar pkg/jruby-complete/META-INF/MANIFEST.MF -C pkg/jruby-core ."
+ sh "jar cfm pkg/jruby-core-#{JRUBY_SRC_VERSION}.jar pkg/jruby-complete/META-INF/MANIFEST.MF -C pkg/jruby-core ."
rm "pkg/jruby-complete/META-INF/MANIFEST.MF"
- sh "jar cf pkg/jruby-jars-#{JRUBY_VERSION}/lib/jruby-stdlib-#{JRUBY_VERSION}.jar -C pkg/jruby-complete ."
- cp "pkg/jruby-jars-#{JRUBY_VERSION}/lib/jruby-core-#{JRUBY_VERSION}.jar", 'lib'
- cp "pkg/jruby-jars-#{JRUBY_VERSION}/lib/jruby-stdlib-#{JRUBY_VERSION}.jar", 'lib'
+ sh "jar cf pkg/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar -C pkg/jruby-complete ."
+ cp "pkg/jruby-core-#{JRUBY_SRC_VERSION}.jar", 'lib'
+ cp "pkg/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar", 'lib'
mkdir_p 'lib/jruby-jars'
File.open('lib/jruby-jars/version.rb', 'w') do |file|
- file.write("module JRubyJars\n VERSION = '#{JRUBY_VERSION}'\nend")
+ file.write("module JRubyJars\n VERSION = '#{JRUBY_SRC_VERSION}'\nend")
end
+end
+
+task :clean do
+ rm_f 'lib/jruby-jars/version.rb'
+ rm_f 'lib/*.jar'
+end
- File.open('Manifest.txt', 'w') do |file|
- file.write <<EOS
+file "lib/jruby-jars/version.rb" => :update
+file "lib/jruby-core-#{JRUBY_SRC_VERSION}.jar" => :update
+file "lib/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar" => :update
+
+File.open('Manifest.txt', 'w') do |file|
+ file.write <<EOS
History.txt
Manifest.txt
README.txt
-lib/jruby-jars/version.rb
lib/jruby-jars.rb
-lib/jruby-core-#{JRUBY_VERSION}.jar
-lib/jruby-stdlib-#{JRUBY_VERSION}.jar
+lib/jruby-jars/version.rb
+lib/jruby-core-#{JRUBY_SRC_VERSION}.jar
+lib/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar
EOS
- end
end
-Hoe.new('jruby-jars', JRUBY_VERSION) do |p|
- p.rubyforge_name = 'jruby-extras' # if different than lowercase project name
- p.developer('Charles Oliver Nutter', 'charles.nutter@sun.com')
+Hoe.spec('jruby-jars') do |p|
+ p.version = JRUBY_SRC_VERSION
+ p.rubyforge_name = 'jruby-extras'
+ p.developer('Charles Oliver Nutter', 'headius@headius.com')
end
@@ -1,3 +0,0 @@
-module JRubyJars
- VERSION = '1.3.1'
-end

0 comments on commit 731d38d

Please sign in to comment.