-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
61 lines (53 loc) · 1.5 KB
/
Rakefile
File metadata and controls
61 lines (53 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'rake'
require 'rake/clean'
require 'rbconfig'
require 'rspec/core/rake_task'
include RbConfig
CLEAN.include(
'**/*.gem', # Gem files
'**/*.rbc', # Rubinius
'**/*.lock', # Bundler
'**/*.o', # C object file
'**/*.log', # Ruby extension build log
'**/Makefile', # C Makefile
'**/*.def', # Definition files
'**/*.exp',
'**/*.lib',
'**/*.pdb',
'**/*.obj',
'**/*.stackdump', # Junk that can happen on Windows
"**/*.#{CONFIG['DLEXT']}" # C shared object
)
make = CONFIG['host_os'] =~ /mingw|cygwin/i ? 'make' : 'nmake'
desc "Build the win32-xpath library"
task :build => [:clean] do
require 'devkit' if CONFIG['host_os'] =~ /mingw|cygwin/i
Dir.chdir('ext') do
ruby "extconf.rb"
sh make
cp 'xpath.so', 'win32' # For testing
end
end
namespace :gem do
desc "Build the win32-xpath gem"
task :create => [:clean] do
require 'rubygems/package'
spec = Gem::Specification.load('win32-xpath.gemspec')
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
Gem::Package.build(spec)
end
task "Install the win32-xpath gem"
task :install => [:create] do
file = Dir["*.gem"].first
sh "gem install -l #{file}"
end
end
desc "Run benchmarks"
task :bench => [:build] do
ruby "-Iext bench/bench_win32_xpath.rb"
end
desc "Run the test suite"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '-Iext'
end
task :default => [:build, :spec]