diff options
Diffstat (limited to 'Rakefile')
-rwxr-xr-x | Rakefile | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -10,11 +10,18 @@ RuboCop::RakeTask.new(:rubocop) do |task| task.patterns = ['src/ruby/{lib,spec}/**/*.rb'] end +spec = Gem::Specification.load('grpc.gemspec') + +Gem::PackageTask.new(spec) do |pkg| +end + # Add the extension compiler task -Rake::ExtensionTask.new 'grpc' do |ext| +Rake::ExtensionTask.new('grpc_c', spec) do |ext| ext.source_pattern = '**/*.{c,h}' ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc') ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc') + ext.cross_compile = true + ext.cross_platform = ['x86-mingw32', 'x64-mingw32'] end # Define the test suites @@ -51,6 +58,24 @@ namespace :suite do end end +desc 'Build the gem file under rake_compiler_dock' +task 'gem:windows' do + require 'digest' + require 'rake_compiler_dock' + + grpc_config = ENV['GRPC_CONFIG'] || 'opt' + V = ENV['V'] || '0' + + version = Digest::SHA1.file('third_party/rake-compiler-dock/Dockerfile').hexdigest + image_name = 'grpc/rake-compiler-dock:' + version + cmd = "docker build -t #{image_name} third_party/rake-compiler-dock" + puts cmd + system cmd + exit 1 unless $? == 0 + ENV['RAKE_COMPILER_DOCK_IMAGE'] = image_name + RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0 GRPC_CONFIG=#{grpc_config} V=#{V}" +end + # Define dependencies between the suites. task 'suite:wrapper' => [:compile, :rubocop] task 'suite:idiomatic' => 'suite:wrapper' |