-
Notifications
You must be signed in to change notification settings - Fork 15
/
Rakefile
71 lines (57 loc) · 1.67 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
require 'yard'
require 'yard/rake/yardoc_task'
load File.expand_path("../tasks/remove_task.rake", __FILE__)
require 'ci/reporter/rake/rspec'
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
end
task :spec => [:compile]
desc "Remove the compiled artifacts"
task :clean do
Dir['**/*.class'].each { |fn| rm_rf fn }
end
desc "Compile the java adapter code"
task :compile do
puts "Compiling java support code"
jars = Dir['lib/ladle/apacheds/*.jar'].collect { |fn| File.expand_path(fn) }
javac = ENV['JAVA_HOME'] ? ENV['JAVA_HOME'] + "/bin/javac" : "javac"
one_cmd(
javac, '-cp', "'#{jars.join(':')}'",
('-verbose' if Rake.application.options.trace),
'lib/ladle/java/net/detailedbalance/ladle/*.java')
end
# build task is provided by bundler's gem helper
task :build => [:clean, :compile]
remove_task(:release)
desc "Release both the Ruby and JRuby variants of Ladle"
task :release do
system("rake -f meta.rakefile release")
end
desc "Run the yard server with automatic reloading enabled"
task :yard => ['yard:auto']
namespace :yard do
YARD::Rake::YardocTask.new(:once) do |t|
t.options = ["--title", "Ladle #{Ladle::VERSION}"]
end
task :auto do
one_cmd("bundle exec yard server --reload")
end
desc "Remove the YARD cache and the generated docs"
task :clean do
rm_rf '.yardoc'
rm_rf 'doc'
end
end
namespace :ci do
ENV["CI_REPORTS"] = "reports/spec-xml"
desc "Run specs for CI"
task :spec => ['ci:setup:rspec', 'rake:spec']
end
def one_cmd(*cmd)
str = cmd.compact.join(' ')
puts str if Rake.application.options.trace
system(str)
end