Skip to content

Commit

Permalink
wrap in a LoadError
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed Feb 9, 2013
1 parent 81bc2d3 commit 6038943
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions tasks/extension.rake
Expand Up @@ -4,31 +4,35 @@
# spec.add_development_dependency( 'rake-compiler', '~> 0.8.1' ) # spec.add_development_dependency( 'rake-compiler', '~> 0.8.1' )
# #
# in your top level rakefile # in your top level rakefile
require 'rake/extensiontask' begin
require 'rake/javaextensiontask' require 'rake/extensiontask'
require 'rake/javaextensiontask'


if RUBY_PLATFORM == "java" then if RUBY_PLATFORM == "java" then


Rake::JavaExtensionTask.new( This.name) do |ext| Rake::JavaExtensionTask.new( This.name) do |ext|
ext.ext_dir = File.join( 'ext', This.name, "java" ) ext.ext_dir = File.join( 'ext', This.name, "java" )
ext.lib_dir = File.join( 'lib', This.name ) ext.lib_dir = File.join( 'lib', This.name )
ext.gem_spec = This.java_gemspec ext.gem_spec = This.java_gemspec
end end

else


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


Rake::ExtensionTask.new( This.name ) do |ext| ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
ext.ext_dir = File.join( 'ext', This.name, "c" ) ext.cross_platform = 'i386-mswin32' # forces the Windows platform instead of the default one
ext.lib_dir = File.join( 'lib', This.name ) # configure options only for cross compile
ext.gem_spec = This.ruby_gemspec end

ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
ext.cross_platform = 'i386-mswin32' # 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 end


CLOBBER << FileList["lib/**/*.{jar,so,bundle}"] CLOBBER << FileList["lib/**/*.{jar,so,bundle}"]
CLOBBER << FileList["lib/#{This.name}/1.{8,9}/"] CLOBBER << FileList["lib/#{This.name}/1.{8,9}/"]
task :test_requirements => :compile

0 comments on commit 6038943

Please sign in to comment.