Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (33 sloc) 1.071 kb
112ed41 Charles Lowell project skeleton
authored
1 #!/usr/bin/env rake
b2e3057 Charles Lowell Outline reference data structures.
authored
2 require 'bundler/setup'
112ed41 Charles Lowell project skeleton
authored
3 require "bundler/gem_tasks"
8201268 Charles Lowell bring in the basic extension template and test suite
authored
4
5 task :clean do
b2e3057 Charles Lowell Outline reference data structures.
authored
6 sh "rm -rf lib/v8/init.bundle lib/v8/init.so"
8201268 Charles Lowell bring in the basic extension template and test suite
authored
7 sh "rm -rf pkg"
8 end
9
23f1654 Charles Lowell add basic template for compiling extension and hooking into jsapi_spec t...
authored
10 require "rake/extensiontask"
b2e3057 Charles Lowell Outline reference data structures.
authored
11 Rake::ExtensionTask.new("init", eval(File.read("therubyracer.gemspec"))) do |ext|
23f1654 Charles Lowell add basic template for compiling extension and hooking into jsapi_spec t...
authored
12 ext.ext_dir = "ext/v8"
8201268 Charles Lowell bring in the basic extension template and test suite
authored
13 ext.lib_dir = "lib/v8"
14 ext.source_pattern = "*.{cc,h}"
15 end
16
23f1654 Charles Lowell add basic template for compiling extension and hooking into jsapi_spec t...
authored
17 require 'rspec/core/rake_task'
4a4d254 Charles Lowell don't run memspecs as part of CI build.
authored
18 RSpec::Core::RakeTask.new(:spec) do |task|
3c6c0c5 Charles Lowell don't run thread specs as part of the CI build.
authored
19 task.rspec_opts = '--tag ~memory --tag ~threads'
4a4d254 Charles Lowell don't run memspecs as part of CI build.
authored
20 end
8201268 Charles Lowell bring in the basic extension template and test suite
authored
21
23f1654 Charles Lowell add basic template for compiling extension and hooking into jsapi_spec t...
authored
22 task :sanity => [:clean, :compile] do
23 sh %q{ruby -Ilib -e "require 'v8'"}
24 end
8201268 Charles Lowell bring in the basic extension template and test suite
authored
25
c1fa29b Charles Lowell Rake task for installing the native gem
authored
26 NativeGem = "pkg/therubyracer-#{V8::VERSION}-#{Gem::Platform.new(RUBY_PLATFORM)}.gem"
27 file NativeGem => :build do
aeaad34 Charles Lowell Rake task to build binary gem for native platform
authored
28 require "rubygems/compiler"
c1fa29b Charles Lowell Rake task for installing the native gem
authored
29 compiler = Gem::Compiler.new("pkg/therubyracer-#{V8::VERSION}.gem", 'pkg')
aeaad34 Charles Lowell Rake task to build binary gem for native platform
authored
30 compiler.compile
31 end
32
c1fa29b Charles Lowell Rake task for installing the native gem
authored
33 desc "Build #{NativeGem} into the pkg directory"
34 task "build:native" => NativeGem
35
36 desc "Build and install #{File.basename NativeGem} into system gems"
37 task "install:native" => "build:native" do
38 sh "gem install #{NativeGem}"
39 end
40
23f1654 Charles Lowell add basic template for compiling extension and hooking into jsapi_spec t...
authored
41 task :default => :spec
8201268 Charles Lowell bring in the basic extension template and test suite
authored
42
Something went wrong with that request. Please try again.