mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Project Reference LegacyTarget Crash Fix (#982)
* Avoid force-unwrapping and allow `.none` type target to continue * Add changelog entry
This commit is contained in:
@@ -402,7 +402,7 @@ public class PBXProjGenerator {
|
||||
let productProxy = addObject(
|
||||
PBXContainerItemProxy(
|
||||
containerPortal: .fileReference(projectFileReference),
|
||||
remoteGlobalID: .object(targetObject.product!),
|
||||
remoteGlobalID: targetObject.product.flatMap(PBXContainerItemProxy.RemoteGlobalID.object),
|
||||
proxyType: .reference,
|
||||
remoteInfo: target
|
||||
)
|
||||
@@ -417,7 +417,7 @@ public class PBXProjGenerator {
|
||||
|
||||
let productReferenceProxy = addObject(
|
||||
PBXReferenceProxy(
|
||||
fileType: Xcode.fileType(path: Path(targetObject.productNameWithExtension()!)),
|
||||
fileType: targetObject.productNameWithExtension().flatMap { Xcode.fileType(path: Path($0)) },
|
||||
path: path,
|
||||
remote: productProxy,
|
||||
sourceTree: .buildProductsDir
|
||||
@@ -433,14 +433,14 @@ public class PBXProjGenerator {
|
||||
)
|
||||
)
|
||||
|
||||
guard let productType = targetObject.productType,
|
||||
let buildConfigurations = targetObject.buildConfigurationList?.buildConfigurations,
|
||||
guard let buildConfigurations = targetObject.buildConfigurationList?.buildConfigurations,
|
||||
let defaultConfigurationName = targetObject.buildConfigurationList?.defaultConfigurationName,
|
||||
let defaultConfiguration = buildConfigurations.first(where: { $0.name == defaultConfigurationName }) ?? buildConfigurations.first else {
|
||||
|
||||
fatalError("Missing target info")
|
||||
}
|
||||
|
||||
let productType: PBXProductType = targetObject.productType ?? .none
|
||||
let buildSettings = defaultConfiguration.buildSettings
|
||||
let settings = Settings(buildSettings: buildSettings, configSettings: [:], groups: [])
|
||||
let deploymentTargetString = buildSettings[platform.deploymentTargetSetting] as? String
|
||||
|
||||
Reference in New Issue
Block a user