80 lines
2.6 KiB
Diff
80 lines
2.6 KiB
Diff
|
diff --git a/ruby/Rakefile b/ruby/Rakefile
|
||
|
index c05e115..20144b7 100644
|
||
|
--- a/ruby/Rakefile
|
||
|
+++ b/ruby/Rakefile
|
||
|
@@ -1,6 +1,4 @@
|
||
|
require "rubygems"
|
||
|
-require "rubygems/package_task"
|
||
|
-require "rake/extensiontask" unless RUBY_PLATFORM == "java"
|
||
|
require "rake/testtask"
|
||
|
|
||
|
spec = Gem::Specification.load("google-protobuf.gemspec")
|
||
|
@@ -95,57 +93,6 @@ else
|
||
|
FileUtils.cp(utf8_root+"/range2-neon.c", "ext/google/protobuf_c")
|
||
|
FileUtils.cp(utf8_root+"/range2-sse.c", "ext/google/protobuf_c")
|
||
|
end
|
||
|
-
|
||
|
- Rake::ExtensionTask.new("protobuf_c", spec) do |ext|
|
||
|
- unless RUBY_PLATFORM =~ /darwin/
|
||
|
- # TODO: also set "no_native to true" for mac if possible. As is,
|
||
|
- # "no_native" can only be set if the RUBY_PLATFORM doing
|
||
|
- # cross-compilation is contained in the "ext.cross_platform" array.
|
||
|
- ext.no_native = true
|
||
|
- end
|
||
|
- ext.ext_dir = "ext/google/protobuf_c"
|
||
|
- ext.lib_dir = "lib/google"
|
||
|
- ext.cross_compile = true
|
||
|
- ext.cross_platform = [
|
||
|
- 'x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt',
|
||
|
- 'x86_64-linux', 'x86-linux',
|
||
|
- 'x86_64-darwin', 'arm64-darwin',
|
||
|
- ]
|
||
|
- end
|
||
|
-
|
||
|
- task 'gem:java' do
|
||
|
- sh "rm Gemfile.lock"
|
||
|
- require 'rake_compiler_dock'
|
||
|
- # Specify the repo root as the working and mount directory to provide access
|
||
|
- # to the java directory
|
||
|
- repo_root = File.realdirpath File.join(Dir.pwd, '..')
|
||
|
- RakeCompilerDock.sh <<-"EOT", platform: 'jruby', rubyvm: :jruby, mountdir: repo_root, workdir: repo_root
|
||
|
- sudo apt-get install maven -y && \
|
||
|
- cd java && mvn install -Dmaven.test.skip=true && cd ../ruby && \
|
||
|
- bundle && \
|
||
|
- IN_DOCKER=true rake compile gem
|
||
|
- EOT
|
||
|
- end
|
||
|
-
|
||
|
- task 'gem:windows' do
|
||
|
- sh "rm Gemfile.lock"
|
||
|
- require 'rake_compiler_dock'
|
||
|
- ['x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt', 'x86_64-linux', 'x86-linux'].each do |plat|
|
||
|
- RakeCompilerDock.sh <<-"EOT", platform: plat
|
||
|
- bundle && \
|
||
|
- IN_DOCKER=true rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem RUBY_CC_VERSION=3.1.0:3.0.0:2.7.0:2.6.0
|
||
|
- EOT
|
||
|
- end
|
||
|
- end
|
||
|
-
|
||
|
- if RUBY_PLATFORM =~ /darwin/
|
||
|
- task 'gem:native' do
|
||
|
- system "rake genproto"
|
||
|
- system "rake cross native gem RUBY_CC_VERSION=3.1.0:3.0.0:2.7.0:2.6.0"
|
||
|
- end
|
||
|
- else
|
||
|
- task 'gem:native' => [:genproto, 'gem:windows', 'gem:java']
|
||
|
- end
|
||
|
end
|
||
|
|
||
|
task :genproto => genproto_output
|
||
|
@@ -154,9 +101,6 @@ task :clean do
|
||
|
sh "rm -f #{genproto_output.join(' ')}"
|
||
|
end
|
||
|
|
||
|
-Gem::PackageTask.new(spec) do |pkg|
|
||
|
-end
|
||
|
-
|
||
|
# Skip build/genproto in Bazel builds, where we expect this to
|
||
|
# be done already.
|
||
|
Rake::TestTask.new(:test => ENV['BAZEL'] == 'true' ? [] : [:build, :genproto]) do |t|
|