-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathRakefile
53 lines (38 loc) · 1.23 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
49
50
51
52
53
# frozen_string_literal: true
# ==========================================================
# Packaging
# ==========================================================
GEMSPEC = Gem::Specification.load("rotoscope.gemspec")
require "bundler/gem_tasks"
require "rubygems/package_task"
Gem::PackageTask.new(GEMSPEC) do |pkg|
end
# ==========================================================
# Ruby Extension
# ==========================================================
require "rake/extensiontask"
Rake::ExtensionTask.new("rotoscope", GEMSPEC) do |ext|
ext.lib_dir = "lib/rotoscope"
end
task(build: :compile)
task install: [:build] do |_t|
sh "gem build rotoscope.gemspec && gem install rotoscope-*.gem"
end
# ==========================================================
# Testing
# ==========================================================
require "rake/testtask"
require "ruby_memcheck"
RubyMemcheck.config(binary_name: "rotoscope")
test_config = lambda do |t|
t.test_files = FileList["test/*_test.rb"]
end
Rake::TestTask.new(test: :build, &test_config)
namespace :test do
RubyMemcheck::TestTask.new(valgrind: :build, &test_config)
end
task :rubocop do
require "rubocop/rake_task"
RuboCop::RakeTask.new
end
task(default: [:test, :rubocop])