diff --git a/Rakefile b/Rakefile index df986e2..f35a3bc 100644 --- a/Rakefile +++ b/Rakefile @@ -21,12 +21,20 @@ 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 +NativeGem = "pkg/therubyracer-#{V8::VERSION}-#{Gem::Platform.new(RUBY_PLATFORM)}.gem" +file NativeGem => :build do require "rubygems/compiler" - compiler = Gem::Compiler.new("pkg/therubyracer-#{V8::VERSION}.gem", File.expand_path('../pkg', __FILE__)) + compiler = Gem::Compiler.new("pkg/therubyracer-#{V8::VERSION}.gem", 'pkg') compiler.compile end +desc "Build #{NativeGem} into the pkg directory" +task "build:native" => NativeGem + +desc "Build and install #{File.basename NativeGem} into system gems" +task "install:native" => "build:native" do + sh "gem install #{NativeGem}" +end + task :default => :spec