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

43 lines
1 KiB
Text
Raw Normal View History

2011-11-09 13:46:51 -05:00
#!/usr/bin/env rake
2012-05-01 14:53:01 -04:00
require 'bundler/setup'
2011-11-09 13:46:51 -05:00
require "bundler/gem_tasks"
task :clean do
2012-05-01 14:53:01 -04:00
sh "rm -rf lib/v8/init.bundle lib/v8/init.so"
sh "rm -rf pkg"
end
require "rake/extensiontask"
2012-05-01 14:53:01 -04:00
Rake::ExtensionTask.new("init", eval(File.read("therubyracer.gemspec"))) do |ext|
ext.ext_dir = "ext/v8"
ext.lib_dir = "lib/v8"
ext.source_pattern = "*.{cc,h}"
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = '--tag ~memory'
end
task :sanity => [:clean, :compile] do
sh %q{ruby -Ilib -e "require 'v8'"}
end
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", '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