-
-
Notifications
You must be signed in to change notification settings - Fork 921
/
Rakefile
63 lines (53 loc) · 2 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- ruby -*-
require 'rubygems'
require 'hoe'
task :default => :package
JRUBY_SRC_VERSION = IO.readlines("../default.build.properties").detect {|l| l =~ /^version\.jruby=(.*)/} && $1
file 'pkg/jruby-complete-#{JRUBY_SRC_VERSION}.jar' => "pkg" do
pkg_dir = File.expand_path('pkg')
fail "Run `ant dist' first to create complete jar" unless File.exist?("../dist/jruby-complete-#{JRUBY_SRC_VERSION}.jar")
cp "../dist/jruby-complete-#{JRUBY_SRC_VERSION}.jar", pkg_dir
end
desc "Run to update jars and versions"
task :update => 'pkg/jruby-complete-#{JRUBY_SRC_VERSION}.jar' do
rm_f 'lib/*.jar'
%w(pkg/jruby-core pkg/jruby-stdlib/META-INF).each {|d| rm_rf d; mkdir_p d }
Dir.chdir("pkg/jruby-core") do
sh "jar xf ../jruby-complete-#{JRUBY_SRC_VERSION}.jar"
mv "META-INF/jruby.home", "../jruby-stdlib/META-INF"
rm_rf "cext"
end
sh "jar cfm pkg/jruby-core-#{JRUBY_SRC_VERSION}.jar pkg/jruby-core/META-INF/MANIFEST.MF -C pkg/jruby-core ."
sh "jar cf pkg/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar -C pkg/jruby-stdlib ."
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_SRC_VERSION}'\nend")
end
end
task :clean do
rm_f 'lib/jruby-jars/version.rb'
rm_f 'lib/*.jar'
end
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.rb
lib/jruby-jars/version.rb
lib/jruby-core-#{JRUBY_SRC_VERSION}.jar
lib/jruby-stdlib-#{JRUBY_SRC_VERSION}.jar
EOS
end
Hoe.plugin :gemcutter
Hoe.spec('jruby-jars') do |p|
p.version = JRUBY_SRC_VERSION.downcase
p.rubyforge_name = 'jruby-extras'
p.url = 'http://github.com/jruby/jruby/tree/master/gem/'
p.developer('Charles Oliver Nutter', 'headius@headius.com')
end