Sha256: f68b00ec81a3642c937702e8deb40706d83c0f4c9a62bf36b01a0a91064b5ca1

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

begin
  gem 'rake-compiler', '~>0.7'
  require 'rake/extensiontask'
  require 'rake/javaextensiontask'

  def gemspec
    @clean_gemspec ||= Gem::Specification::load(File.expand_path('../../do_oracle.gemspec', __FILE__))
  end

  unless JRUBY
    Rake::ExtensionTask.new('do_oracle', gemspec) do |ext|

      ext.lib_dir = "lib/#{gemspec.name}"

      # automatically add build options to avoid need of manual input
      if RUBY_PLATFORM =~ /mswin|mingw/ then
      else
        ext.cross_compile = true
        ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
      end
    end
  end

  Rake::JavaExtensionTask.new('do_oracle', gemspec) do |ext|
    ext.lib_dir   = "lib/#{gemspec.name}"
    ext.ext_dir   = 'ext-java/src/main/java'
    ext.debug     = ENV.has_key?('DO_JAVA_DEBUG') && ENV['DO_JAVA_DEBUG']
    ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar:../jdbc_drivers/oracle/ojdbc5.jar'
    ext.java_compiling do |gem|

      # Hack: Unfortunately there is no way to remove a dependency in the
      #       Gem::Specification API.
      gem.dependencies.delete_if { |d| d.name == 'ruby-oci8'}

      gem.add_dependency "do_jdbc", '0.10.9'
    end
  end
rescue LoadError
  warn "To compile, install rake-compiler (gem install rake-compiler)"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
do_oracle-0.10.9 tasks/compile.rake
do_oracle-0.10.9-x86-mswin32-60 tasks/compile.rake
do_oracle-0.10.9-x86-mingw32 tasks/compile.rake
do_oracle-0.10.9-java tasks/compile.rake