14
14
1. Unique reference identifiers
15
15
2. Human readable reference identifiers
16
16
3. Stable reference identifiers
17
-
17
+
18
18
(as opposed to the generated UUIDs Xcode typically generates)
19
-
19
+
20
20
We create identifiers with a constant-length unique prefix and
21
21
a unique suffix where the suffix is the filename or module name
22
22
and since we guarantee uniqueness at the PackageDescription
@@ -29,7 +29,8 @@ import PackageType
29
29
30
30
let rootObjectReference = " __RootObject_ "
31
31
let rootBuildConfigurationListReference = " ___RootConfs_ "
32
- let rootBuildConfigurationReference = " _______Debug_ "
32
+ let rootDebugBuildConfigurationReference = " _______Debug_ "
33
+ let rootReleaseBuildConfigurationReference = " _____Release_ "
33
34
let rootGroupReference = " ___RootGroup_ "
34
35
let productsGroupReference = " ____Products_ "
35
36
let testProductsGroupReference = " TestProducts_ "
@@ -40,14 +41,15 @@ let sourceGroupFileRefPrefix = "__PBXFileRef_"
40
41
let compilePhaseFileRefPrefix = " __src_cc_ref_ "
41
42
42
43
extension Module {
43
- var dependencyReference : String { return " __Dependency_ \( c99name) " }
44
- var productReference : String { return " _____Product_ \( c99name) " }
45
- var targetReference : String { return " ______Target_ \( c99name) " }
46
- var groupReference : String { return " _______Group_ \( c99name) " }
47
- var configurationListReference : String { return " _______Confs_ \( c99name) " }
48
- var configurationReference : String { return " ___DebugConf_ \( c99name) " }
49
- var compilePhaseReference : String { return " CompilePhase_ \( c99name) " }
50
- var linkPhaseReference : String { return " ___LinkPhase_ \( c99name) " }
44
+ var dependencyReference : String { return " __Dependency_ \( c99name) " }
45
+ var productReference : String { return " _____Product_ \( c99name) " }
46
+ var targetReference : String { return " ______Target_ \( c99name) " }
47
+ var groupReference : String { return " _______Group_ \( c99name) " }
48
+ var configurationListReference : String { return " _______Confs_ \( c99name) " }
49
+ var debugConfigurationReference : String { return " ___DebugConf_ \( c99name) " }
50
+ var releaseConfigurationReference : String { return " _ReleaseConf_ \( c99name) " }
51
+ var compilePhaseReference : String { return " CompilePhase_ \( c99name) " }
52
+ var linkPhaseReference : String { return " ___LinkPhase_ \( c99name) " }
51
53
}
52
54
53
55
func fileRef( forLinkPhaseChild module: Module ) -> String {
@@ -139,12 +141,23 @@ extension SwiftModule {
139
141
}
140
142
}
141
143
142
- var buildSettings : String {
144
+ var debugBuildSettings : String {
145
+ var buildSettings = commonBuildSettings
146
+ buildSettings [ " SWIFT_OPTIMIZATION_LEVEL " ] = " -Onone "
147
+
148
+ return buildSettings. map { " \( $0) = \( $1) ; " } . joined ( separator: " " )
149
+ }
150
+
151
+ var releaseBuildSettings : String {
152
+ let buildSettings = commonBuildSettings
153
+ return buildSettings. map { " \( $0) = \( $1) ; " } . joined ( separator: " " )
154
+ }
155
+
156
+ private var commonBuildSettings : [ String : String ] {
143
157
var buildSettings = [ " PRODUCT_NAME " : productName]
144
158
buildSettings [ " PRODUCT_MODULE_NAME " ] = c99name
145
159
buildSettings [ " OTHER_SWIFT_FLAGS " ] = " -DXcode "
146
160
buildSettings [ " MACOSX_DEPLOYMENT_TARGET " ] = " '10.10' "
147
- buildSettings [ " SWIFT_OPTIMIZATION_LEVEL " ] = " -Onone "
148
161
149
162
// prevents Xcode project upgrade warnings
150
163
buildSettings [ " COMBINE_HIDPI_IMAGES " ] = " YES "
@@ -176,7 +189,7 @@ extension SwiftModule {
176
189
}
177
190
}
178
191
179
- return buildSettings. map { " \( $0 ) = \( $1 ) ; " } . joined ( separator : " " )
192
+ return buildSettings
180
193
}
181
194
}
182
195
0 commit comments