INNER CODE UNIT · Swift
expectedName
skiptools/skip · Plugins/SkipPlugin/SkipPlugin.swift:112
let expectedName = kotlinModule + testSuffix
// Known issue with SPM in Xcode: we cannot have a dependency from one testTarget to another, or we hit the error:
// Enable to resolve build file: XCBCore.BuildFile (The workspace has a reference to a missing target with GUID 'PACKAGE-TARGET:SkipLibTests')
// so we cannot use `target.dependencies.first` to find the target; we just need to scan by name
guard let dependencyTarget = try context.package.targets(named: [expectedName]).first else {
throw SkipPluginError(errorDescription: "Target «\(target.name)» should have a peer test target named «\(expectedName)»")
}
peerTarget = dependencyTarget
} else {
let expectedName = kotlinModule
guard let dependencyTarget = try context.package.targets(named: [expectedName]).first else {
throw SkipPluginError(errorDescription: "Target «\(target.name)» should have a peer test target named «\(expectedName)»")
}
peerTarget = dependencyTarget