@@ -144,12 +144,16 @@ https://github.com/MobileNativeFoundation/rules_xcodeproj/issues/new?template=bu
144144 throw PreconditionError ( message: " Settings not found for target/command combination: \( guid) / \( buildRequest. command) " )
145145 }
146146
147+ var ids = settings. base
147148 for platform in allPlatformsToSearch ( buildRequest. platform) {
148149 guard let platform = settings. platforms [ platform] else { continue }
149- for prefix in prefixes {
150- for id in platform ?? settings. base {
151- lines. append ( " \( target. label) \n \( prefix) \( id) " )
152- }
150+ // An explicit nil value in platforms indicates inheritence from base
151+ ids = platform ?? settings. base
152+ break
153+ }
154+ for prefix in prefixes {
155+ for id in ids {
156+ lines. append ( " \( target. label) \n \( prefix) \( id) " )
153157 }
154158 }
155159 }
@@ -228,18 +232,18 @@ extension PIF.Target.BuildConfiguration {
228232 let platform = String ( key. dropFirst ( 20 ) . dropLast ( 2 ) )
229233 if value == " $(BAZEL_TARGET_ID) " {
230234 // This value indicates that the provided platform inherits from the base build setting. Store nil for later processing.
231- build? . platforms [ platform] = nil
235+ build? . platforms [ platform] = Optional < [ String ] > . none
232236 } else {
233- build? . platforms [ platform] = [ value]
237+ build? . platforms [ platform] = . some ( [ value] )
234238 }
235239 }
236240 if buildFiles != nil , key. starts ( with: " BAZEL_COMPILE_TARGET_IDS[sdk= " ) {
237241 let platform = String ( key. dropFirst ( 29 ) . dropLast ( 2 ) )
238242 if value == " $(BAZEL_COMPILE_TARGET_IDS) " {
239243 // This value indicates that the provided platform inherits from the base build setting. Store nil for later processing.
240- buildFiles? . platforms [ platform] = nil
244+ buildFiles? . platforms [ platform] = Optional < [ String ] > . none
241245 } else {
242- buildFiles? . platforms [ platform] = compileTargetIds ( value)
246+ buildFiles? . platforms [ platform] = . some ( compileTargetIds ( value) )
243247 }
244248 }
245249 }
0 commit comments