Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit ca17867

Browse files
author
Brian Durand
committed
make java build task more forgiving of stray source files
1 parent 755b811 commit ca17867

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Rakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,21 @@ task :release => :package do
3232
end
3333

3434
namespace :java do
35-
desc "Build the jar files for Jruby support"
35+
desc "Build the jar files for Jruby support. You must set your JRUBY_HOME environment variable to the root of your jruby install."
3636
task :build do
3737
base_dir = File.dirname(__FILE__)
3838
tmp_dir = File.join(base_dir, "tmp")
3939
classes_dir = File.join(tmp_dir, "classes")
4040
jar_dir = File.join(base_dir, "lib", "org", "jruby", "ext", "ref")
4141
FileUtils.rm_rf(classes_dir)
4242
ext_dir = File.join(base_dir, "ext", "java")
43-
source_files = FileList["#{base_dir}/**/*.java"]
43+
source_files = FileList["#{base_dir}/ext/**/*.java"]
4444
jar_file = File.join(jar_dir, 'references.jar')
4545
# Only build if any of the source files have changed
4646
up_to_date = File.exist?(jar_file) && source_files.all?{|f| File.mtime(f) <= File.mtime(jar_file)}
4747
unless up_to_date
4848
FileUtils.mkdir_p(classes_dir)
49+
puts "#{ENV['JAVA_HOME']}/bin/javac -target 1.5 -classpath '#{"#{ENV['JRUBY_HOME']}/lib/jruby.jar"}' -d '#{classes_dir}' -sourcepath '#{ext_dir}' '#{source_files.join("' '")}'"
4950
`#{ENV['JAVA_HOME']}/bin/javac -target 1.5 -classpath '#{"#{ENV['JRUBY_HOME']}/lib/jruby.jar"}' -d '#{classes_dir}' -sourcepath '#{ext_dir}' '#{source_files.join("' '")}'`
5051
if $? == 0
5152
FileUtils.rm_rf(jar_dir) if File.exist?(jar_dir)

0 commit comments

Comments
 (0)