From aeaad343b82002691c119285b8b59715a048e82e Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 14 Jun 2012 04:20:28 -0500 Subject: [PATCH] Rake task to build binary gem for native platform --- Rakefile | 7 +++++++ therubyracer.gemspec | 1 + 2 files changed, 8 insertions(+) diff --git a/Rakefile b/Rakefile index 6a01c28..df986e2 100644 --- a/Rakefile +++ b/Rakefile @@ -21,5 +21,12 @@ task :sanity => [:clean, :compile] do sh %q{ruby -Ilib -e "require 'v8'"} end +desc "Build therubyracer-#{V8::VERSION}-#{Gem::Platform.new(RUBY_PLATFORM)}.gem into the pkg directory" +task "build:native" => :build do + require "rubygems/compiler" + compiler = Gem::Compiler.new("pkg/therubyracer-#{V8::VERSION}.gem", File.expand_path('../pkg', __FILE__)) + compiler.compile +end + task :default => :spec diff --git a/therubyracer.gemspec b/therubyracer.gemspec index 1122f89..cf28138 100644 --- a/therubyracer.gemspec +++ b/therubyracer.gemspec @@ -20,5 +20,6 @@ Gem::Specification.new do |gem| gem.add_development_dependency "rake" gem.add_development_dependency "rake-compiler" + gem.add_development_dependency "gem-compiler" gem.add_development_dependency "rspec", "~> 2.0" end