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 sourcesGroupReference = " _____Sources_ "
@@ -39,14 +40,15 @@ let sourceGroupFileRefPrefix = "__PBXFileRef_"
39
40
let compilePhaseFileRefPrefix = " __src_cc_ref_ "
40
41
41
42
extension Module {
42
- var dependencyReference : String { return " __Dependency_ \( c99name) " }
43
- var productReference : String { return " _____Product_ \( c99name) " }
44
- var targetReference : String { return " ______Target_ \( c99name) " }
45
- var groupReference : String { return " _______Group_ \( c99name) " }
46
- var configurationListReference : String { return " _______Confs_ \( c99name) " }
47
- var configurationReference : String { return " ___DebugConf_ \( c99name) " }
48
- var compilePhaseReference : String { return " CompilePhase_ \( c99name) " }
49
- var linkPhaseReference : String { return " ___LinkPhase_ \( c99name) " }
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 debugConfigurationReference : String { return " ___DebugConf_ \( c99name) " }
49
+ var releaseConfigurationReference : String { return " _ReleaseConf_ \( c99name) " }
50
+ var compilePhaseReference : String { return " CompilePhase_ \( c99name) " }
51
+ var linkPhaseReference : String { return " ___LinkPhase_ \( c99name) " }
50
52
}
51
53
52
54
func fileRef( forLinkPhaseChild module: Module ) -> String {
@@ -138,12 +140,23 @@ extension SwiftModule {
138
140
}
139
141
}
140
142
141
- var buildSettings : String {
143
+ var debugBuildSettings : String {
144
+ var buildSettings = commonBuildSettings
145
+ buildSettings [ " SWIFT_OPTIMIZATION_LEVEL " ] = " -Onone "
146
+
147
+ return buildSettings. map { " \( $0) = \( $1) ; " } . joinWithSeparator ( " " )
148
+ }
149
+
150
+ var releaseBuildSettings : String {
151
+ let buildSettings = commonBuildSettings
152
+ return buildSettings. map { " \( $0) = \( $1) ; " } . joinWithSeparator ( " " )
153
+ }
154
+
155
+ private var commonBuildSettings : [ String : String ] {
142
156
var buildSettings = [ " PRODUCT_NAME " : productName]
143
157
buildSettings [ " PRODUCT_MODULE_NAME " ] = c99name
144
158
buildSettings [ " OTHER_SWIFT_FLAGS " ] = " -DXcode "
145
159
buildSettings [ " MACOSX_DEPLOYMENT_TARGET " ] = " '10.10' "
146
- buildSettings [ " SWIFT_OPTIMIZATION_LEVEL " ] = " -Onone "
147
160
148
161
// prevents Xcode project upgrade warnings
149
162
buildSettings [ " COMBINE_HIDPI_IMAGES " ] = " YES "
@@ -175,7 +188,7 @@ extension SwiftModule {
175
188
}
176
189
}
177
190
178
- return buildSettings. map { " \( $0 ) = \( $1 ) ; " } . joinWithSeparator ( " " )
191
+ return buildSettings
179
192
}
180
193
}
181
194
0 commit comments