aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-29 20:00:43 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-04-29 20:00:43 +0200
commit1f8b6da920799d3aaa6f4d17f87c0caf87b76b3e (patch)
tree5a7dd23b1f492650ae3f70212109e79744c672d9
parentcbb6b285d7211dfa3cff1cc6ab2c3c78e5719b23 (diff)
Few tweaks to the rakefile to permit native gems compilation with the proto files generation.
-rw-r--r--ruby/Gemfile.lock2
-rw-r--r--ruby/Rakefile64
-rw-r--r--ruby/google-protobuf.gemspec2
3 files changed, 36 insertions, 32 deletions
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock
index 27e57506..d0eb9cc4 100644
--- a/ruby/Gemfile.lock
+++ b/ruby/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- google-protobuf (3.0.0.alpha.5.0)
+ google-protobuf (3.0.0.alpha.5.0.5)
GEM
remote: https://rubygems.org/
diff --git a/ruby/Rakefile b/ruby/Rakefile
index 8eb7a2df..45694d1f 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -5,6 +5,38 @@ require "rake/testtask"
spec = Gem::Specification.load("google-protobuf.gemspec")
+well_known_protos = %w[
+ google/protobuf/any.proto
+ google/protobuf/api.proto
+ google/protobuf/duration.proto
+ google/protobuf/empty.proto
+ google/protobuf/field_mask.proto
+ google/protobuf/source_context.proto
+ google/protobuf/struct.proto
+ google/protobuf/timestamp.proto
+ google/protobuf/type.proto
+ google/protobuf/wrappers.proto
+]
+
+# These are omitted for now because we don't support proto2.
+proto2_protos = %w[
+ google/protobuf/descriptor.proto
+ google/protobuf/compiler/plugin.proto
+]
+
+genproto_output = []
+
+unless ENV['IN_DOCKER'] == 'true'
+ well_known_protos.each do |proto_file|
+ input_file = "../src/" + proto_file
+ output_file = "lib/" + proto_file.sub(/\.proto$/, ".rb")
+ genproto_output << output_file
+ file output_file => input_file do |file_task|
+ sh "../src/protoc -I../src --ruby_out=lib #{input_file}"
+ end
+ end
+end
+
if RUBY_PLATFORM == "java"
if `which mvn` == ''
raise ArgumentError, "maven needs to be installed"
@@ -30,38 +62,10 @@ else
task 'gem:windows' do
require 'rake_compiler_dock'
- RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6"
+ RakeCompilerDock.sh "bundle && IN_DOCKER=true rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.5:2.0.0"
end
-end
-well_known_protos = %w[
- google/protobuf/any.proto
- google/protobuf/api.proto
- google/protobuf/duration.proto
- google/protobuf/empty.proto
- google/protobuf/field_mask.proto
- google/protobuf/source_context.proto
- google/protobuf/struct.proto
- google/protobuf/timestamp.proto
- google/protobuf/type.proto
- google/protobuf/wrappers.proto
-]
-
-# These are omitted for now because we don't support proto2.
-proto2_protos = %w[
- google/protobuf/descriptor.proto
- google/protobuf/compiler/plugin.proto
-]
-
-genproto_output = []
-
-well_known_protos.each do |proto_file|
- input_file = "../src/" + proto_file
- output_file = "lib/" + proto_file.sub(/\.proto$/, ".rb")
- genproto_output << output_file
- file output_file => input_file do |file_task|
- sh "../src/protoc -I../src --ruby_out=lib #{input_file}"
- end
+ task 'gem:native' => [:genproto, 'gem:windows']
end
diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec
index 7b64ee77..1fa626fe 100644
--- a/ruby/google-protobuf.gemspec
+++ b/ruby/google-protobuf.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "google-protobuf"
- s.version = "3.0.0.alpha.5.0"
+ s.version = "3.0.0.alpha.5.0.5"
s.licenses = ["BSD"]
s.summary = "Protocol Buffers"
s.description = "Protocol Buffers are Google's data interchange format."