-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
43 lines (33 loc) · 961 Bytes
/
Rakefile
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
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubygems/package_task'
require 'rake/extensiontask'
Dir['tasks/**/*.rake'].each { |file| load(file) }
RSpec::Core::RakeTask.new(:spec)
task default: :spec
namespace :spec do
task :quick do
ENV['SKIP_MEMSAFETY_SPECS'] = '1'
Rake::Task[:spec].invoke
end
end
Rake::ExtensionTask.new('character_set') do |ext|
ext.lib_dir = 'lib/character_set'
end
namespace :java do
java_gemspec = eval File.read('./character_set.gemspec')
java_gemspec.platform = 'java'
java_gemspec.extensions = []
java_gemspec.add_runtime_dependency 'range_compressor', '~> 1.0'
Gem::PackageTask.new(java_gemspec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
pkg.package_dir = 'pkg'
end
end
task package: 'java:gem'
unless RUBY_PLATFORM =~ /java/
# recompile before benchmarking or running specs
task(:benchmark).enhance([:compile])
task(:spec).enhance([:compile])
end