forked from TestingWithFrank/PublicAutomation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
29 lines (23 loc) · 967 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
27
28
29
def discover_latest_sdk_version
latest_iphone_sdk = `xcodebuild -showsdks | grep -o "iphoneos.*$"`.chomp
version_part = latest_iphone_sdk[/iphoneos(.*)/,1]
version_part
end
desc "Build the arm library"
task :build_iphone_lib do
sh "xcodebuild -configuration Debug -sdk iphoneos#{discover_latest_sdk_version} BUILD_DIR=build clean build"
end
desc "Build the i386 library"
task :build_simulator_lib do
sh "xcodebuild -configuration Debug -sdk iphonesimulator#{discover_latest_sdk_version} BUILD_DIR=build clean build"
end
task :combine_libraries do
FileUtils.mkdir_p 'dist'
sh %Q|lipo -create -output "dist/libPublicAutomation.a" "build/Debug-iphoneos/libPublicAutomation.a" "build/Debug-iphonesimulator/libPublicAutomation.a"|
end
task :copy_headers do
raise 'TODO'
end
desc "Build a univeral library for both iphone and iphone simulator"
task :build_lib => [:build_iphone_lib,:build_simulator_lib,:combine_libraries]
task :default => :build_lib