mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Remove file/product reference for legacy targets
Apparently legacy targets created by Xcode do not have a file or product reference. Xodeproj is unable to parse legacy targets generated with XcodeGen with the following error message:
`Xcodeproj doesn't know about the following attributes {"productReference"=>"FR_184465694726"} for the 'PBXLegacyTarget' isa.`
This commit removes file and product references for legacy targets.
This commit is contained in:
@@ -129,22 +129,24 @@ public class PBXProjGenerator {
|
||||
lastKnownFileType = fileType
|
||||
}
|
||||
|
||||
let fileReference = createObject(
|
||||
id: target.name,
|
||||
PBXFileReference(
|
||||
sourceTree: .buildProductsDir,
|
||||
explicitFileType: explicitFileType,
|
||||
lastKnownFileType: lastKnownFileType,
|
||||
path: target.filename,
|
||||
includeInIndex: false
|
||||
if !target.isLegacy {
|
||||
let fileReference = createObject(
|
||||
id: target.name,
|
||||
PBXFileReference(
|
||||
sourceTree: .buildProductsDir,
|
||||
explicitFileType: explicitFileType,
|
||||
lastKnownFileType: lastKnownFileType,
|
||||
path: target.filename,
|
||||
includeInIndex: false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
targetFileReferences[target.name] = fileReference.reference
|
||||
targetBuildFiles[target.name] = createObject(
|
||||
id: fileReference.reference,
|
||||
PBXBuildFile(fileRef: fileReference.reference)
|
||||
)
|
||||
targetFileReferences[target.name] = fileReference.reference
|
||||
targetBuildFiles[target.name] = createObject(
|
||||
id: fileReference.reference,
|
||||
PBXBuildFile(fileRef: fileReference.reference)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
try project.targets.forEach(generateTarget)
|
||||
@@ -507,7 +509,7 @@ public class PBXProjGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
let fileReference = targetFileReferences[target.name]!
|
||||
let fileReference = targetFileReferences[target.name]
|
||||
var buildPhases: [String] = []
|
||||
|
||||
func getBuildFilesForPhase(_ buildPhase: BuildPhase) -> [String] {
|
||||
|
||||
Reference in New Issue
Block a user