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
|
# To be used if the gem has extensions.
# If this task set is inclueded then you will need to also have
#
# spec.add_development_dependency( 'rake-compiler', '~> 0.8.1' )
#
# in your top level rakefile
begin
require 'rake/extensiontask'
require 'rake/javaextensiontask'
if RUBY_PLATFORM == "java" then
Rake::JavaExtensionTask.new( This.name) do |ext|
ext.ext_dir = File.join( 'ext', This.name, "java" )
ext.lib_dir = File.join( 'lib', This.name )
ext.gem_spec = This.java_gemspec
end
else
Rake::ExtensionTask.new( This.name ) do |ext|
ext.ext_dir = File.join( 'ext', This.name, "c" )
ext.lib_dir = File.join( 'lib', This.name )
ext.gem_spec = This.ruby_gemspec
ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
ext.cross_platform = %w[x86-mingw32 x64-mingw32] # forces the Windows platform instead of the default one
# configure options only for cross compile
end
end
task :test_requirements => :compile
rescue LoadError
This.task_warning( 'extension' )
end
CLOBBER << FileList["lib/**/*.{jar,so,bundle}"]
CLOBBER << FileList["lib/#{This.name}/{1,2}.*/"]
|