-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
26 lines (21 loc) · 860 Bytes
/
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
PROJECT = "MockNSURLConnection"
CONFIGURATION = "Release"
FRAMEWORK_TARGET = "MockNSURLConnection-OSX"
IOS_FRAMEWORK_TARGET = "MockNSURLConnection-iOS"
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 => ["frameworks"]
desc "Clean all targets"
task :clean do
system_or_exit "rm -rf #{BUILD_DIR}/*"
end
desc "Build frameworks"
task :frameworks do
system_or_exit "xcodebuild -project #{PROJECT}.xcodeproj -target #{FRAMEWORK_TARGET} -configuration #{CONFIGURATION} build SYMROOT=#{BUILD_DIR}"
system_or_exit "xcodebuild -project #{PROJECT}.xcodeproj -target #{IOS_FRAMEWORK_TARGET} -configuration #{CONFIGURATION} build SYMROOT=#{BUILD_DIR}"
end