@@ -59,31 +59,28 @@ public final class ResolvedProduct {
59
59
self . underlyingProduct = product
60
60
self . targets = targets
61
61
62
+ // defaultLocalization is currently shared across the entire package
63
+ // this may need to be enhanced if / when we support localization per target or product
64
+ let defaultLocalization = self . targets. first? . defaultLocalization
65
+ self . defaultLocalization = defaultLocalization
66
+
67
+ let platforms = Self . computePlatforms ( targets: targets)
68
+ self . platforms = platforms
69
+
62
70
self . testEntryPointTarget = underlyingProduct. testEntryPointPath. map { testEntryPointPath in
63
71
// Create an executable resolved target with the entry point file, adding product's targets as dependencies.
64
72
let dependencies : [ Target . Dependency ] = product. targets. map { . target( $0, conditions: [ ] ) }
65
73
let swiftTarget = SwiftTarget ( name: product. name,
66
74
dependencies: dependencies,
67
75
packageAccess: true , // entry point target so treated as a part of the package
68
76
testEntryPointPath: testEntryPointPath)
69
- let ( defaultLocalization, platforms) = if let firstTarget = targets. first {
70
- ( firstTarget. defaultLocalization, firstTarget. platforms)
71
- } else {
72
- ( . none, . init( declared: [ ] , derivedXCTestPlatformProvider: . none) ) // safe since this is a derived product
73
- }
74
77
return ResolvedTarget (
75
78
target: swiftTarget,
76
79
dependencies: targets. map { . target( $0, conditions: [ ] ) } ,
77
- defaultLocalization: defaultLocalization,
80
+ defaultLocalization: defaultLocalization ?? . none , // safe since this is a derived product
78
81
platforms: platforms
79
82
)
80
83
}
81
-
82
- // defaultLocalization is currently shared across the entire package
83
- // this may need to be enhanced if / when we support localization per target or product
84
- self . defaultLocalization = self . targets. first? . defaultLocalization
85
-
86
- self . platforms = Self . computePlatforms ( targets: targets)
87
84
}
88
85
89
86
/// True if this product contains Swift targets.
0 commit comments