From 0e9aa5293adab7aca6ba38707656b262b5364245 Mon Sep 17 00:00:00 2001 From: ignisf Date: Sat, 14 Jun 2014 13:32:45 +0300 Subject: [PATCH] Cosmetic changes to the Rakefile --- Rakefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 589d052..8e310d2 100644 --- a/Rakefile +++ b/Rakefile @@ -6,14 +6,14 @@ RSpec::Core::RakeTask.new(:spec) module Helpers module_function - def get_binary_gemspec(platform = RUBY_PLATFORM) + def binary_gemspec(platform = RUBY_PLATFORM) gemspec = eval(File.read('libv8.gemspec')) gemspec.platform = Gem::Platform.new(platform) gemspec end def binary_gem_name - File.basename get_binary_gemspec.cache_file + File.basename binary_gemspec.cache_file end end @@ -24,24 +24,29 @@ end desc "build a binary gem #{Helpers.binary_gem_name}" task :binary => :compile do - gemspec = Helpers.get_binary_gemspec + gemspec = Helpers.binary_gemspec gemspec.extensions.clear + # We don't need most things for the binary gemspec.files = [] gemspec.files += ['lib/libv8.rb', 'lib/libv8/version.rb'] gemspec.files += ['ext/libv8/arch.rb', 'ext/libv8/location.rb', 'ext/libv8/paths.rb'] gemspec.files += ['ext/libv8/.location.yml'] + # V8 gemspec.files += Dir['vendor/v8/include/*'] gemspec.files += Dir['vendor/v8/out/**/*.a'] + FileUtils.chmod 'a+r', gemspec.files FileUtils.mkdir_p 'pkg' + package = if Gem::VERSION < '2.0.0' Gem::Builder.new(gemspec).build else require 'rubygems/package' Gem::Package.build(gemspec) end + FileUtils.mv(package, 'pkg') end