-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
56 lines (47 loc) · 1 KB
/
Copy pathRakefile
File metadata and controls
56 lines (47 loc) · 1 KB
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
require "stringio"
require "colorize"
# drop these so that FileUtils doesn't print out...
STD_OUT = $stdout
STD_ERR = $stderr
$stdout = StringIO.new
$stderr = StringIO.new
require "fileutils"
include FileUtils
task :destroy_build do
STD_OUT.puts
STD_OUT.puts "Emptying /build folder...".blue
rm_rf "build"
mkdir "build"
STD_OUT.puts " Complete.".green
end
task :make_tmp => [:destroy_tmp] do
mkdir "tmp"
end
task :lint do
begin
system "./bin/build tmp"
system "./bin/lint tmp"
raise unless $?.success?
rescue
STD_ERR.puts "Lint found errors, can not continue with build.".red
STD_ERR.puts
exit 1
end
end
task :test do
begin
system "./bin/test"
raise unless $?.exitstatus == 0
rescue
STD_ERR.puts "Test had failures, can not continue with build.".red
STD_ERR.puts
exit 1
end
end
task :destroy_tmp do
rm_rf "tmp"
end
task :build => [:destroy_build, :make_tmp, :lint, :test, :destroy_tmp] do
system "./bin/build build"
end
task :default => :build