-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathRakefile
71 lines (56 loc) · 1.24 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
lein_exe = "lein2"
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
DIRS = %w{chee joodo}
DIRS.each do |dir|
namespace dir do
desc "full #{dir} build"
task :build do
in_dir dir do
run_command "#{lein_exe} spec"
run_command "#{lein_exe} install"
end
end
desc "push to clojars"
task :push do
in_dir dir do
run_command "#{lein_exe} deploy clojars"
end
end
desc "install locally"
task :install do
in_dir dir do
run_command "#{lein_exe} install"
end
end
desc "runs specs"
task :spec do
in_dir dir do
run_command "#{lein_exe} spec"
end
end
end
end
desc "build all projects"
task :build => DIRS.map {|dir| "#{dir}:build"}
desc "push all projects"
task :push => DIRS.map {|dir| "#{dir}:push"}
desc "install all projects"
task :install => DIRS.map {|dir| "#{dir}:install"}
desc "run all specs"
task :spec => DIRS.map {|dir| "#{dir}:spec"}
task :default => :build