forked from reiseburo/hermann
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Rakefile
49 lines (40 loc) · 1.04 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
require 'rubygems'
require 'fileutils'
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
require 'rake/extensiontask'
require 'ci/reporter/rake/rspec'
Rake::ExtensionTask.new do |t|
t.name = 'hermann_rdkafka'
t.ext_dir = 'ext/hermann'
t.gem_spec = Gem::Specification.load('hermann.gemspec')
end
def add_rspec_options(options)
if RUBY_PLATFORM == 'java'
options << '--tag ~platform:mri'
else
options << '--tag ~platform:java'
end
return options
end
RSpec::Core::RakeTask.new(:spec) do |r|
options = add_rspec_options(['--tag ~type:integration'])
r.rspec_opts = options.join(' ')
end
namespace :spec do
RSpec::Core::RakeTask.new(:integration) do |r|
options = add_rspec_options(['--tag type:integration'])
r.rspec_opts = options.join(' ')
end
end
desc 'Remove the entire ./tmp directory'
task :removetmp do
FileUtils.rm_rf('tmp')
end
task :clean => [:removetmp]
if RUBY_PLATFORM == 'java'
task :default => [:clean, :spec]
else
task :build => [:compile]
task :default => [:clean, :build, :spec]
end