forked from slagyr/joodo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
55 lines (48 loc) · 1.1 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
def run_command(command)
system command
exit_code = $?.exitstatus
if exit_code != 0
raise "Command failed with code #{exit_code}: #{command}"
else
puts "Command executed successfully: #{command}"
end
end
def in_dir(path)
pwd = Dir.getwd
Dir.chdir path
yield
ensure
Dir.chdir pwd
end
namespace :joodo do
desc "full joodo build"
task :build do
in_dir "joodo" do
run_command "lein deps, javac"
run_command "lein spec"
end
end
end
namespace :lein_joodo do
desc "init lein-joodo"
task :init do
in_dir "lein-joodo" do
if !File.exists?("leiningen-1.7.0-standalone.jar")
puts "downloading Leiningen"
run_command "wget https://github.com/downloads/technomancy/leiningen/leiningen-1.7.0-standalone.jar"
else
puts "Leiningen already downloaded"
end
end
end
desc "full lein-joodo build"
task :build => %w{init} do
in_dir "lein-joodo" do
run_command "lein deps, javac"
run_command "lein spec"
end
end
end
desc "full build"
task :build => %w{joodo:build lein_joodo:build}
task :default => :build