1
0
Fork 0
mirror of https://github.com/rubyjs/libv8 synced 2023-03-27 23:21:48 -04:00

Cosmetic changes to the Rakefile

This commit is contained in:
ignisf 2014-06-14 13:32:45 +03:00
parent 1ba8077c78
commit 0e9aa5293a

View file

@ -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