-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
48 lines (39 loc) · 1.02 KB
/
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
44
45
46
47
48
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/extensiontask"
require "rake/testtask"
require "rspec/core/rake_task"
require "yard"
Rake.add_rakelib("lib/tasks")
RSpec::Core::RakeTask.new(:spec)
task default: :spec
task :dev do
ENV["RB_SYS_CARGO_PROFILE"] = "dev"
end
CROSS_PLATFORMS = %w[
x86_64-linux
x86_64-linux-musl
aarch64-linux
x86_64-darwin
arm64-darwin
x64-mingw-ucrt
x64-mingw32
]
gemspec = Bundler.load_gemspec("reprise.gemspec")
Rake::ExtensionTask.new("reprise", gemspec) do |ext|
ext.lib_dir = "lib/reprise"
ext.cross_compile = true
ext.cross_platform = CROSS_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
YARD::Rake::YardocTask.new do |t|
t.options = %w[--output-dir ./docs]
end
task :remove_ext do
path = "lib/reprise/reprise.bundle"
File.unlink(path) if File.exist?(path)
end
Rake::Task["build"].enhance([:remove_ext])