-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
42 lines (35 loc) · 977 Bytes
/
Copy pathRakefile
File metadata and controls
42 lines (35 loc) · 977 Bytes
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
# frozen_string_literal: true
require "rake/testtask"
require "rb_sys/extensiontask"
task default: :test
GEMSPEC = Gem::Specification.load("osv.gemspec")
platforms = [
"x86_64-linux",
"x86_64-linux-musl",
"aarch64-linux",
"aarch64-linux-musl",
"x86_64-darwin",
"arm64-darwin"
]
RbSys::ExtensionTask.new("osv", GEMSPEC) do |ext|
ext.lib_dir = "lib/osv"
ext.ext_dir = "ext/osv"
ext.cross_compile = true
ext.cross_platform = platforms
ext.cross_compiling do |spec|
spec.dependencies.reject! { |dep| dep.name == "rb_sys" }
spec.files.reject! { |file| File.fnmatch?("ext/*", file, File::FNM_EXTGLOB) }
end
end
Rake::TestTask.new do |t|
t.deps << :compile
t.test_files = FileList[File.expand_path("test/*_test.rb", __dir__)]
t.libs << "lib"
t.libs << "test"
end
task :release do
sh "bundle exec rake test"
sh "mkdir -p pkg"
sh "gem build osv.gemspec -o pkg/osv-#{OSV::VERSION}.gem"
sh "gem push pkg/osv-#{OSV::VERSION}.gem"
end