File: Rakefile

package info (click to toggle)
jruby 1.5.6-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 45,088 kB
  • ctags: 77,093
  • sloc: ruby: 398,491; java: 170,202; yacc: 3,782; xml: 2,529; sh: 299; tcl: 40; makefile: 35; ansic: 23
file content (66 lines) | stat: -rw-r--r-- 2,135 bytes parent folder | download | duplicates (4)
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
64
65
66
# -*- 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

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-#{JRUBY_SRC_VERSION}.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-#{JRUBY_SRC_VERSION}.jar"
    mv core_files_and_dirs, "../jruby-core"
  end
  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-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_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.developer('Charles Oliver Nutter', 'headius@headius.com')
end