Skip to content

Commit

Permalink
gem: rake tasks for native darwin gem
Browse files Browse the repository at this point in the history
and make sure we gitignore the .bundle files
  • Loading branch information
flavorjones committed Sep 7, 2020
1 parent d0cf141 commit 94ecf99
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ ext/java/nokogiri/**/*.class
ext/nokogiri/*.dll
gems
lib/nokogiri/**/nokogiri.so
lib/nokogiri/nokogiri.bundle
lib/nokogiri/**/nokogiri.bundle
lib/nokogiri/nokogiri.jar
lib/nokogiri/nokogiri.rb
pkg
ports
stash
Expand Down
24 changes: 18 additions & 6 deletions tasks/cross-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,28 @@ def verify_dll(dll, cross_ruby)
end
end

desc "build native fat binary gems for windows"
multitask "windows" => CROSS_RUBIES.map(&:platform).uniq.grep(WINDOWS_PLATFORM_REGEX)

desc "build native fat binary gems for linux"
multitask "linux" => CROSS_RUBIES.map(&:platform).uniq.grep(LINUX_PLATFORM_REGEX)

desc "build a jruby gem"
task "jruby" do
RakeCompilerDock.sh "gem install bundler --no-document && bundle && rake java gem", rubyvm: "jruby"
end

CROSS_RUBIES.find_all { |cr| cr.darwin? }.map(&:platform).uniq.each do |plat|
desc "build native gem for #{plat} platform"
task plat do
sh "find ~/.gem -name extensiontask.rb | while read f ; do sed -i '' 's/callback.call(spec) if callback/@cross_compiling.call(spec) if @cross_compiling/' \$f ; done"
Rake::Task["native:#{plat}"].invoke
Rake::Task["pkg/#{HOE.spec.full_name}-#{Gem::Platform.new(plat).to_s}.gem"].invoke
end
end

desc "build native gems for windows"
multitask "windows" => CROSS_RUBIES.find_all(&:windows?).map(&:platform).uniq

desc "build native gems for linux"
multitask "linux" => CROSS_RUBIES.find_all(&:linux?).map(&:platform).uniq

desc "build native gems for darwin"
multitask "darwin" => CROSS_RUBIES.find_all(&:darwin?).map(&:platform).uniq
end

if java?
Expand Down

0 comments on commit 94ecf99

Please sign in to comment.