All non-masgn nodes will get non-null value during parsing process (removes one sourc...
[jruby.git] / Rakefile
blobef9d5e8602b816563853d0fcd24b12764662926c
1 task :default => [:build]
3 File.open("default.build.properties") do |props|
4   props.each_line do |line|
5     # skip comments
6     next if line =~ /^\W*#/
7     
8     # build const name
9     name, value = line.split("=")
10     name.gsub!(".", "_").upcase!
11     Object.const_set(name.to_sym, value)
12     
13     # substitute embedded props
14     value.chop!.gsub!(/\$\{([^}]+)\}/) do |embed|
15       Object.const_get($1.gsub!(".", "_").upcase!)
16     end
17   end
18 end
20 def ant(*args)
21   system "ant -logger org.apache.tools.ant.NoBannerLogger #{args.join(' ')}"
22 end
24 desc "Build JRuby"
25 task :build do
26   ant "jar"
27 end
28 task :jar => :build
30 desc "Alias for test:short"
31 task :test => "test:short"
33 desc "Alias for spec:ci"
34 task :spec => "spec:ci"
36 namespace :test do
37   desc "Compile test code"
38   task :compile do
39     ant "compile-test"
40     system "jar cf build/jruby-test-classes.jar -C build/classes/test ."
41   end
43   desc "Run the basic set of tests"
44   task :short do
45     ant "test"
46   end
47   
48   desc "Run the complete set of tests (will take a while)"
49   task :all do
50     ant "test-all"
51   end
52 end
54 file "build/jruby-test-classes.jar" do
55   Rake::Task['test:compile'].invoke
56 end
58 namespace :spec do
59   desc "Run the rubyspecs expected to pass (version-frozen)"
60   task :ci do
61     ant "spec"
62   end
63   
64   desc "Run all the specs including failures (version-frozen)"
65   task :all do
66     ant "spec-all"
67   end
69   require 'spec/rake/spectask'
70   desc "Runs Java Integration Specs"
71   Spec::Rake::SpecTask.new("ji" => "build/jruby-test-classes.jar") do |t|
72     t.spec_opts ||= []
73     t.spec_opts << "--options" << "test/spec/java_integration/spec.opts"
74     t.spec_files = FileList['test/spec/java_integration/**/*_spec.rb']
75   end
76 end
78 desc "Clean all built output"
79 task :clean do
80   delete_files = FileList.new do |fl|
81     fl.
82       include("#{BUILD_DIR}/**").
83       exclude("#{BUILD_DIR}/rubyspec").
84       include(DIST_DIR).
85       include(API_DOCS_DIR)
86   end
87   
88   delete_files.each {|files| rm_rf files, :verbose => true}
89 end
91 desc "Generate sources, compile and add to jar file"
92 task :gen do
93   mkdir_p 'src_gen'
94   system 'apt -nocompile -cp lib/jruby.jar:build_lib/asm-3.0.jar:build_lib/asm-util-3.0.jar -factory org.jruby.anno.AnnotationBinder src/org/jruby/*.java'
95   system 'javac -cp lib/jruby.jar src_gen/*.java'
96   system 'jar -uf lib/jruby.jar -C src_gen .'
97 end