This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[all multi] Implement Jeweler + rake-compiler
* Use the new rake-compiler JavaExtensionTask. * Also, no need to specify require path (inherit default). Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
- Loading branch information
Showing
45 changed files
with
430 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
if (tasks_dir = ROOT.parent + 'tasks').directory? | ||
require tasks_dir + 'ext_helper_java' | ||
setup_java_extension("#{$gemspec.name}_ext", $gemspec) | ||
end | ||
begin | ||
gem('rake-compiler') | ||
require 'rake/javaextensiontask' | ||
|
||
Rake::JavaExtensionTask.new('do_derby_ext', $gem_spec) do |ext| | ||
ext.ext_dir = 'ext-java/src/main/java' | ||
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar' | ||
ext.java_compiling do |gem_spec| | ||
gem_spec.post_install_message = <<EOF | ||
========================================================================== | ||
task :compile => ["compile:jruby"] | ||
DataObjects Derby Driver: | ||
You've installed the binary extension for JRuby (Java platform) | ||
========================================================================== | ||
EOF | ||
end | ||
end | ||
rescue LoadError | ||
warn "To compile, install rake-compiler (gem install rake-compiler)" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
if (tasks_dir = ROOT.parent + 'tasks').directory? | ||
require tasks_dir + 'ext_helper_java' | ||
setup_java_extension("#{$gemspec.name}_ext", $gemspec) | ||
end | ||
begin | ||
gem('rake-compiler') | ||
require 'rake/javaextensiontask' | ||
|
||
Rake::JavaExtensionTask.new('do_h2_ext', $spec) do |ext| | ||
ext.ext_dir = 'ext-java/src/main/java' | ||
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar' | ||
ext.java_compiling do |gem_spec| | ||
gem_spec.post_install_message = <<EOF | ||
========================================================================== | ||
task :compile => ["compile:jruby"] | ||
DataObjects H2 Driver: | ||
You've installed the binary extension for JRuby (Java platform) | ||
========================================================================== | ||
EOF | ||
end | ||
end | ||
rescue LoadError | ||
warn "To compile, install rake-compiler (gem install rake-compiler)" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
if (tasks_dir = ROOT.parent + 'tasks').directory? | ||
require tasks_dir + 'ext_helper_java' | ||
setup_java_extension("#{$gemspec.name}_ext", $gemspec) | ||
end | ||
begin | ||
gem('rake-compiler') | ||
require 'rake/javaextensiontask' | ||
|
||
Rake::JavaExtensionTask.new('do_hsqldb_ext', $gem_spec) do |ext| | ||
ext.ext_dir = 'ext-java/src/main/java' | ||
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar' | ||
ext.java_compiling do |gem_spec| | ||
gem_spec.post_install_message = <<EOF | ||
========================================================================== | ||
task :compile => ["compile:jruby"] | ||
DataObjects HSQLDB Driver: | ||
You've installed the binary extension for JRuby (Java platform) | ||
========================================================================== | ||
EOF | ||
end | ||
end | ||
rescue LoadError | ||
warn "To compile, install rake-compiler (gem install rake-compiler)" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
if (tasks_dir = ROOT.parent + 'tasks').directory? | ||
require tasks_dir + 'ext_helper_java' | ||
setup_java_extension("#{$gemspec.name}_internal", $gemspec, :source_dir => 'src/main/java', :add_buildr_task => false) | ||
end | ||
begin | ||
gem('rake-compiler') | ||
require 'rake/javaextensiontask' | ||
|
||
Rake::JavaExtensionTask.new('do_jdbc_internal', $spec) do |ext| | ||
ext.ext_dir = 'src/main/java' | ||
#ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar' | ||
ext.java_compiling do |gem_spec| | ||
gem_spec.post_install_message = <<EOF | ||
========================================================================== | ||
task :compile => ["compile:jruby"] | ||
DataObjects JDBC Support Library: | ||
You've installed the JDBC Support Library for JRuby (Java platform) | ||
========================================================================== | ||
EOF | ||
end | ||
end | ||
rescue LoadError | ||
warn "To compile, install rake-compiler (gem install rake-compiler)" | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module DataObjects | ||
module Mysql | ||
VERSION = '0.10.1' | ||
VERSION = '0.10.1'.freeze | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
tasks_dir = ROOT.parent + 'tasks' | ||
|
||
begin | ||
gem('rake-compiler') | ||
require 'rake/extensiontask' | ||
require 'rake/javaextensiontask' | ||
|
||
Rake::ExtensionTask.new('do_mysql_ext', $gemspec) do |ext| | ||
|
||
mysql_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', "mysql-#{BINARY_VERSION}-win32")) | ||
|
||
# automatically add build options to avoid need of manual input | ||
if RUBY_PLATFORM =~ /mswin|mingw/ then | ||
ext.config_options << "--with-mysql-include=#{mysql_lib}/include" | ||
ext.config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt" | ||
else | ||
ext.cross_compile = true | ||
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60'] | ||
ext.cross_config_options << "--with-mysql-include=#{mysql_lib}/include" | ||
ext.cross_config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt" | ||
end | ||
|
||
end | ||
|
||
Rake::JavaExtensionTask.new('do_mysql_ext', $gemspec) do |ext| | ||
ext.ext_dir = 'ext-java/src/main/java' | ||
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar' | ||
ext.java_compiling do |gem| | ||
gem.add_dependency 'jdbc-mysql', '>=5.0.4' | ||
gem.add_dependency 'do_jdbc', '0.10.1' | ||
gem.post_install_message = <<EOF | ||
========================================================================== | ||
DataObjects MySQL Driver: | ||
You've installed the binary extension for JRuby (Java platform) | ||
========================================================================== | ||
EOF | ||
# components, files and paths | ||
# gem.files = Dir['lib/**/*.rb', 'spec/**/*.rb', 'tasks/**/*.rake', | ||
# 'LICENSE', 'Rakefile', '*.{markdown,rdoc,txt,yml}', 'lib/*.jar'] | ||
end | ||
end | ||
rescue LoadError | ||
warn "To compile, install rake-compiler (gem install rake-compiler)" | ||
end | ||
|
||
# Stolen from http://github.com/karottenreibe/joker/blob/master/tasks/c_extensions.rake: | ||
# | ||
# Workaround for rake-compiler, which YAML-dump-loads the gemspec, which leads | ||
# to errors since Procs can't be loaded. | ||
Rake::Task.tasks.each do |task_name| | ||
case task_name.to_s | ||
when /^native|java/ | ||
task_name.prerequisites.unshift("fix_rake_compiler_gemspec_dump") | ||
end | ||
end | ||
|
||
task :fix_rake_compiler_gemspec_dump do | ||
%w{files extra_rdoc_files test_files}.each do |accessor| | ||
$gemspec.send(accessor).instance_eval { @exclude_procs = Array.new } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.