diff --git a/Sources/PackageLoading/PackageBuilder.swift b/Sources/PackageLoading/PackageBuilder.swift index 8d66b587dd5..aeeb86eaaa9 100644 --- a/Sources/PackageLoading/PackageBuilder.swift +++ b/Sources/PackageLoading/PackageBuilder.swift @@ -752,7 +752,7 @@ public final class PackageBuilder { default: targetType = sources.computeTargetType() if targetType == .executable && manifest.toolsVersion >= .v5_4 && warnAboutImplicitExecutableTargets { - diagnostics.emit(warning: "in tools version \(ToolsVersion.v5_4) and later, use 'executableTarget()' to declare executable targets") + diagnostics.emit(warning: "'\(potentialModule.name)' was identified as an executable target given the presence of a 'main.swift' file. Starting with tools version \(ToolsVersion.v5_4) executable targets should be declared as 'executableTarget()'") } } diff --git a/Tests/PackageLoadingTests/PackageBuilderTests.swift b/Tests/PackageLoadingTests/PackageBuilderTests.swift index 61025587ba2..33806f22732 100644 --- a/Tests/PackageLoadingTests/PackageBuilderTests.swift +++ b/Tests/PackageLoadingTests/PackageBuilderTests.swift @@ -482,7 +482,7 @@ class PackageBuilderTests: XCTestCase { ] ) PackageBuilderTester(manifest, in: fs) { package, diagnostics in - diagnostics.check(diagnostic: "in tools version 5.4.0 and later, use 'executableTarget()' to declare executable targets", behavior: .warning) + diagnostics.check(diagnostic: "'exec2' was identified as an executable target given the presence of a 'main.swift' file. Starting with tools version 5.4.0 executable targets should be declared as 'executableTarget()'", behavior: .warning) package.checkModule("lib") { _ in } package.checkModule("exec2") { _ in } package.checkProduct("exec2") { product in