Skip to content

Commit

Permalink
Use separate Rakefile for native ext compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Coles <alex@alexbcoles.com>
  • Loading branch information
myabc committed Apr 7, 2012
1 parent 2cf0e75 commit d024641
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
13 changes: 0 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,3 @@ begin
end
rescue LoadError
end

task :simple_compile do
# Pick the right class path, depending if we're using an rvm installed JRuby
jruby_cpath = ENV['MY_RUBY_HOME'] || ENV['JRUBY_HOME']
raise 'MY_RUBY_HOME or JRUBY_HOME are not set' unless jruby_cpath

puts 'Doing a simple compilation'
sh %(javac -source 1.6 -target 1.6 -cp #{jruby_cpath}/lib/jruby.jar ext/java/**/*.java)
mkdir_p 'lib/jrubytesting'
sh %(jar cf lib/jrubytesting/test_jruby_library.jar -C ext/java jrubytesting/TestJrubyLibraryService.class)
puts
end
task :default => :simple_compile
12 changes: 12 additions & 0 deletions ext/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
task :simple_compile do
# Pick the right class path, depending if we're using an rvm installed JRuby
jruby_cpath = ENV['MY_RUBY_HOME'] || ENV['JRUBY_HOME']
raise 'MY_RUBY_HOME or JRUBY_HOME are not set' unless jruby_cpath

puts 'Doing a simple compilation'
sh %(javac -source 1.6 -target 1.6 -cp #{jruby_cpath}/lib/jruby.jar ext/java/**/*.java)
mkdir_p 'lib/jrubytesting'
sh %(jar cf lib/jrubytesting/test_jruby_library.jar -C ext/java jrubytesting/TestJrubyLibraryService.class)
puts
end
task :default => :simple_compile
2 changes: 1 addition & 1 deletion test-jruby-library.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gem::Specification.new do |s|

## This sections is only necessary if you have C extensions.
s.require_paths << 'ext'
s.extensions = %w[Rakefile]
s.extensions = %w[ext/Rakefile]

## If your gem includes any executables, list them here.
# s.executables = ["name"]
Expand Down

0 comments on commit d024641

Please sign in to comment.