forked from slagyr/limelight
/
Rakefile
61 lines (48 loc) · 1.31 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
PROJECT_ROOT = File.expand_path(File.dirname(__FILE__))
TASK_DIR = File.expand_path(File.dirname(__FILE__) + "/etc/tasks")
Gem.clear_paths
ENV["GEM_PATH"] = File.expand_path(File.dirname(__FILE__) + "/etc/gems")
require File.expand_path(File.dirname(__FILE__) + "/lib/limelight/version")
def run_command(command)
output = `#{command}`
exit_code = $?.exitstatus
if exit_code != 0
puts "Command failed with code #{exit_code}: #{command}"
raise output
else
puts "Command executed successfully: #{command}"
end
end
Dir.glob(File.join(TASK_DIR, "*.rake")).each do |rakefile|
load rakefile
end
task :jar do
system "ant jar"
end
task :init => [:jar, :jruby_gems, :dev_gems] do
end
task :spec do
begin
require 'java'
gem 'rspec'
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:lib_specs){|t| t.spec_files = FileList['spec/**/*.rb']}
Rake::Task[:lib_specs].invoke
rescue LoadError
run_command "java -jar lib/jruby-complete-1.4.0.jar -S spec spec"
end
end
task :junit do
run_command "ant unit_test"
end
task :jar do
run_command "ant jar"
end
task :tests => [:junit, :spec]
task :continuous => [:tests_cont]
task :junit_cont do
output = `ant unit_test.cont`
raise output if $?.exitstatus != 0
end
task :tests_cont => [:junit_cont, :spec]
task :default => :continuous