Resolves https://github.com/tuist/tuist/issues/11570
Summary
Allow codeCoverageTargets in project schemes to reference targets from other projects in the workspace, including SPM-generated projects.
Why
Xcode already supports this. In a scheme’s Test action, you can choose “Gather coverage for some targets” and select targets from anywhere in the workspace, including Swift Package Manager packages.
Tuist, however, was stricter and rejected these configurations during project linting:
As a result, tuist generate failed even though the configuration was perfectly valid in Xcode.
Root cause
This happened because three different pieces of logic interacted in an unexpected way:
TestAction+ManifestMapper.swift resolves code coverage targets without an explicit projectPath to the local project.
SchemeLinter.lintCodeCoverageTargets only validates targets that exist in the current project.
SchemeLinter.projectSchemeCantReferenceRemoteTargets treats codeCoverageTargets as regular target dependencies and rejects references to targets outside the project.
At the same time, GraphLinter.lintSchemesUnknownTargets already validates scheme target references against the entire workspace graph and reports unresolved targets when needed.
Change
This PR makes two focused changes in SchemeLinter.swift:
lintCodeCoverageTargets now only validates targets that belong to the current project. References to targets in other projects are left to the graph linter.
projectSchemeCantReferenceRemoteTargets no longer considers codeCoverageTargets when checking for cross-project dependencies, since code coverage targets are coverage configuration rather than actual build dependencies.
This keeps the existing validation for local targets (including typo detection) while allowing valid cross-project coverage configurations that Xcode already supports.
User impact
Project schemes can now include code coverage targets from any project in the workspace, including SPM-generated projects, by using an explicit TargetReference.
Existing behavior remains unchanged for local targets, and invalid references are still caught by the workspace-level graph validation.