-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
30 lines (23 loc) · 1010 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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rubygems/package_task"
require "rake/testtask"
require "rake/extensiontask"
rcee_packaged_tarball_spec = Bundler.load_gemspec("rcee_packaged_tarball.gemspec")
Gem::PackageTask.new(rcee_packaged_tarball_spec).define
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
Rake::ExtensionTask.new("packaged_tarball") do |ext|
ext.lib_dir = "lib/rcee/packaged_tarball"
end
task default: [:clobber, :compile, :test]
CLEAN.add("{ext,lib}/**/*.{o,so}", "pkg")
CLOBBER.add("ports")
# when packaging the gem, if the tarball isn't cached, we need to fetch it. the easiest thing to do
# is to run the compile phase to invoke the extconf and have mini_portile download the file for us.
# this is wasteful and in the future I would prefer to separate mini_portile from the extconf to
# allow us to download without compiling.
Rake::Task["package"].prerequisites.prepend("compile")