From 1e3f93a8593dae08c3db6ee8cecc0bf3b83cc9f2 Mon Sep 17 00:00:00 2001 From: Jerry Marino Date: Mon, 8 Jun 2020 22:55:04 -0700 Subject: [PATCH] Improve target dependency not found fatalError (#883) It's pretty tricky to find out how to fix it otherwise. Hitting this often when using XcodeGen with XCHammer for Bazel Xcode projects. XCHammer simply pulls in transitive targets, but users can filter out a subset of targets based on paths. Both XCHammer and XcodeGen Yaml give users flexibility for specify what targets are in their Xcode project, so it's useful to give them a better validation error if they create one. --- Sources/XcodeGenKit/PBXProjGenerator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index fc177716..02cf0935 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -340,7 +340,7 @@ public class PBXProjGenerator { func generateTargetDependency(from: String, to target: String) -> PBXTargetDependency { guard let targetObject = targetObjects[target] ?? targetAggregateObjects[target] else { - fatalError("target not found") + fatalError("Target dependency not found: from ( \(from) ) to ( \(target) )") } let targetProxy = addObject(