forked from Shopify/semian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (48 loc) · 1.38 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
54
55
56
57
require 'bundler/gem_tasks'
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
rescue LoadError
end
# ==========================================================
# Packaging
# ==========================================================
GEMSPEC = eval(File.read('semian.gemspec'))
require 'rubygems/package_task'
Gem::PackageTask.new(GEMSPEC) do |_pkg|
end
# ==========================================================
# Ruby Extension
# ==========================================================
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require 'semian/platform'
if Semian.sysv_semaphores_supported?
require 'rake/extensiontask'
Rake::ExtensionTask.new('semian', GEMSPEC) do |ext|
ext.ext_dir = 'ext/semian'
ext.lib_dir = 'lib/semian'
end
task build: :compile
else
task :build do
end
end
# ==========================================================
# Testing
# ==========================================================
require 'rake/testtask'
Rake::TestTask.new 'test' do |t|
t.libs = %w(lib test)
t.pattern = "test/*_test.rb"
t.verbose = false
t.warning = false
end
# ==========================================================
# Documentation
# ==========================================================
require 'rdoc/task'
RDoc::Task.new do |rdoc|
rdoc.rdoc_files.include("lib/*.rb", "ext/semian/*.c")
end
task default: :build
task default: :test