-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathRakefile
59 lines (51 loc) · 1.47 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
PROJECT_NAME = "Checkman"
CONFIGURATION = "Release"
OCUNIT_LOGIC_SPECS_TARGET_NAME = "CheckmanTests"
PROJECT_ROOT = File.dirname(__FILE__)
BUILD_DIR = File.join(PROJECT_ROOT, "build")
def system_or_exit(cmd, stdout=nil)
puts "Executing #{cmd}"
cmd += " >#{stdout}" if stdout
system(cmd) or raise "** Build failed **"
end
task :default => %w(
included_scripts:verify_ruby_syntax
included_scripts:integration_specs
)
%w(install build).each do |task_name|
task(task_name) do
system_or_exit "./bin/#{task_name}"
end
end
desc "Clean all targets"
task :clean do
system_or_exit "rm -rf #{BUILD_DIR}/*", "/dev/null"
end
namespace :included_scripts do
desc "Verifies Ruby syntax for included scripts"
task :verify_ruby_syntax do
Dir["./scripts/*.check"].each do |file|
system_or_exit "ruby -c #{file}"
end
end
desc "Run integration specs"
task :integration_specs do
rspec = `which rspec`.strip
raise "** Install rspec **" if rspec.empty?
system_or_exit "#{rspec} scripts/specs/*_spec.rb"
end
end
namespace :ocunit do
desc "Build and run OCUnit logic specs (#{OCUNIT_LOGIC_SPECS_TARGET_NAME})"
task :logic do
ENV["CEDAR_REPORTER_CLASS"] = "CDRColorizedReporter"
system_or_exit <<-SHELL
xcodebuild \
-project #{PROJECT_NAME}.xcodeproj \
-scheme #{OCUNIT_LOGIC_SPECS_TARGET_NAME} \
-configuration #{CONFIGURATION} \
-destination 'arch=x86_64' \
test SYMROOT=#{BUILD_DIR}
SHELL
end
end