Skip to content

Commit b617ed3

Browse files
authored
Fix incorrect executable target diagnostic (#7447)
The determination for executable targets isn't limited to Swift files, it will also find 'main.m' for example. This was originally reflected in the diagnostic, but #3254 updated it incorrectly.
1 parent 848680d commit b617ed3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/PackageLoading/PackageBuilder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ public final class PackageBuilder {
995995
{
996996
self.observabilityScope
997997
.emit(
998-
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()'"
998+
warning: "'\(potentialModule.name)' was identified as an executable target given the presence of a 'main' file. Starting with tools version \(ToolsVersion.v5_4) executable targets should be declared as 'executableTarget()'"
999999
)
10001000
}
10011001
}

Tests/PackageLoadingTests/PackageBuilderTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ final class PackageBuilderTests: XCTestCase {
499499
)
500500
PackageBuilderTester(manifest, in: fs) { package, diagnostics in
501501
diagnostics.check(
502-
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()'",
502+
diagnostic: "'exec2' was identified as an executable target given the presence of a 'main' file. Starting with tools version 5.4.0 executable targets should be declared as 'executableTarget()'",
503503
severity: .warning
504504
)
505505
package.checkModule("lib") { _ in }

0 commit comments

Comments
 (0)