diff options
author | Chris Fallin <cfallin@c1f.net> | 2015-03-10 16:17:20 -0700 |
---|---|---|
committer | Chris Fallin <cfallin@c1f.net> | 2015-03-10 16:17:20 -0700 |
commit | 9861c0d796f254f5575638e1c520db9d723b4fa3 (patch) | |
tree | 6cf4de2cbcb24d53b2475ed15d6a61a98712685c /ruby/Rakefile | |
parent | a5f7bb8ebb60d636c21c18ad2ffeda80e8f80a48 (diff) | |
parent | 27e2b57830c328b83286e055752bf92790587953 (diff) | |
download | protobuf-9861c0d796f254f5575638e1c520db9d723b4fa3.tar.gz protobuf-9861c0d796f254f5575638e1c520db9d723b4fa3.tar.bz2 protobuf-9861c0d796f254f5575638e1c520db9d723b4fa3.zip |
Merge pull request #146 from isaiah/jruby
protobuf support for jruby
Diffstat (limited to 'ruby/Rakefile')
-rw-r--r-- | ruby/Rakefile | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/ruby/Rakefile b/ruby/Rakefile index ae7d8059..7c1d8495 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -1,20 +1,32 @@ -require "rake/extensiontask" +require "rubygems" +require "rubygems/package_task" +require "rake/extensiontask" unless RUBY_PLATFORM == "java" require "rake/testtask" spec = Gem::Specification.load("google-protobuf.gemspec") -Rake::ExtensionTask.new("protobuf_c", spec) do |ext| - ext.ext_dir = "ext/google/protobuf_c" - ext.lib_dir = "lib/google" -end +if RUBY_PLATFORM == "java" + task :clean do + system("mvn clean") + end -Rake::TestTask.new(:test => :build) do |t| - t.test_files = FileList["tests/*.rb"] + task :compile do + system("mvn package") + end +else + Rake::ExtensionTask.new("protobuf_c", spec) do |ext| + ext.ext_dir = "ext/google/protobuf_c" + ext.lib_dir = "lib/google" + end end Gem::PackageTask.new(spec) do |pkg| end +Rake::TestTask.new(:test => :build) do |t| + t.test_files = FileList["tests/*.rb"] +end + task :build => [:clean, :compile] task :default => [:build] |