-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathCakefile
133 lines (86 loc) · 4.04 KB
/
Cakefile
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# https://github.com/jcampbell05/xcake
# http://www.rubydoc.info/github/jcampbell05/xcake/master/file/docs/Cakefile.md
iOSdeploymentTarget = "8.0"
currentSwiftVersion = "4.2"
companyIdentifier = "com.CakeMania"
developmentTeamId = "XYZXYZ" # for automatic debug signing in Xcode 8
testSuffix = "Tst"
#===
project.name = "CakeFamework"
project.class_prefix = "CFW"
project.organization = "CakeMania Inc."
#=== DEFAULT target settings
project.all_configurations.each do |configuration|
# for all configurations
configuration.settings["SDKROOT"] = "iphoneos"
configuration.settings["DEBUG_INFORMATION_FORMAT"] = "dwarf"
configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = "iPhone Developer"
configuration.settings["TARGETED_DEVICE_FAMILY"] = "1,2"
configuration.settings["IPHONEOS_DEPLOYMENT_TARGET"] = iOSdeploymentTarget
configuration.settings["VERSIONING_SYSTEM"] = "apple-generic"
configuration.settings["GCC_NO_COMMON_BLOCKS"] = "YES"
configuration.settings["GCC_WARN_ABOUT_RETURN_TYPE"] = "YES_ERROR"
configuration.settings["GCC_WARN_UNINITIALIZED_AUTOS"] = "YES_AGGRESSIVE"
configuration.settings["CLANG_WARN_DIRECT_OBJC_ISA_USAGE"] = "YES_ERROR"
configuration.settings["CLANG_WARN_OBJC_ROOT_CLASS"] = "YES_ERROR"
configuration.settings["SWIFT_OPTIMIZATION_LEVEL"] = "-Onone"
configuration.settings["CURRENT_PROJECT_VERSION"] = "1" # just default non-empty value
configuration.settings["CLANG_WARN_INFINITE_RECURSION"] = "YES" # Xcode 8
configuration.settings["CLANG_WARN_SUSPICIOUS_MOVE"] = "YES" # Xcode 8
configuration.settings["ENABLE_STRICT_OBJC_MSGSEND"] = "YES" # Xcode 8
#===
if configuration.name == "Release"
configuration.settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
configuration.settings["SWIFT_OPTIMIZATION_LEVEL"] = "-Owholemodule" # Xcode 8
end
end
#===
# Imagine we have project folder structure like this:
#
# - Cakefile
# - Info/
# | - CakeFamework.plist
# | - CakeFameworkTst.plist
# - Src/
# | - ...
# - Tst/
# | - ...
#
#=== TARGETS
target do |target|
target.name = project.name
target.type = :framework
target.language = :swift
target.platform = :ios
target.deployment_target = iOSdeploymentTarget
#=== CUSTOM settings for the target
target.all_configurations.each do |configuration|
#=== Build Settings - Core
configuration.product_bundle_identifier = companyIdentifier + "." + target.name
configuration.settings["INFOPLIST_FILE"] = "Info/" + target.name + ".plist"
configuration.settings["PRODUCT_NAME"] = "$(TARGET_NAME)"
# Xcode 8 automati c signing support
configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = "iPhone Developer"
configuration.settings["DEVELOPMENT_TEAM"] = developmentTeamId
configuration.settings["SWIFT_VERSION"] = currentSwiftVersion # Xcode 8
end
#=== Source Files
# assume all source files are located inside "/Src" folder and its subfolders
target.include_files = ["Src/**/*.*"]
#=== TEST TARGETS
unit_tests_for target do |test_target|
test_target.name = target.name + testSuffix
test_target.deployment_target = iOSdeploymentTarget
test_target.all_configurations.each do |configuration|
configuration.product_bundle_identifier = companyIdentifier + "." + test_target.name
configuration.settings["INFOPLIST_FILE"] = "Info/" + test_target.name + ".plist"
configuration.settings["LD_RUNPATH_SEARCH_PATHS"] = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
# Xcode 8 automati c signing support
configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = "iPhone Developer"
configuration.settings["DEVELOPMENT_TEAM"] = developmentTeamId
configuration.settings["SWIFT_VERSION"] = currentSwiftVersion # Xcode 8
end
#=== Source Files
test_target.include_files = [testSuffix + "/**/*.*"]
end
end