Skip to content

Commit 569cda5

Browse files
committed
Fix incorrect executable target diagnostic
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 549d781 commit 569cda5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/PackageLoading/PackageBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ public final class PackageBuilder {
953953
{
954954
self.observabilityScope
955955
.emit(
956-
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()'"
956+
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()'"
957957
)
958958
}
959959
}

Tests/PackageLoadingTests/PackageBuilderTests.swift

Lines changed: 1 addition & 1 deletion
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)