Skip to content

Commit 53390c6

Browse files
committed
Revert implementation of SwiftTarget init(linuxMain:...)
1 parent 7f35c1a commit 53390c6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Sources/PackageModel/Target.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public final class SwiftTarget: Target {
248248
}
249249

250250
/// Create an executable Swift target from linux main test manifest file.
251-
public convenience init(linuxMain: AbsolutePath, name: String, dependencies: [Target.Dependency]) {
251+
public init(linuxMain: AbsolutePath, name: String, dependencies: [Target.Dependency]) {
252252
// Look for the first swift test target and use the same swift version
253253
// for linux main target. This will need to change if we move to a model
254254
// where we allow per target swift language version build settings.
@@ -261,19 +261,18 @@ public final class SwiftTarget: Target {
261261
// We need to select the latest Swift language version that can
262262
// satisfy the current tools version but there is not a good way to
263263
// do that currently.
264+
self.swiftVersion = swiftTestTarget?.swiftVersion ?? SwiftLanguageVersion(string: String(ToolsVersion.currentToolsVersion.major)) ?? .v4
264265
let sources = Sources(paths: [linuxMain], root: linuxMain.parentDirectory)
265266

266267
let platforms: [SupportedPlatform] = swiftTestTarget?.platforms ?? []
267268

268-
let swiftVersion = swiftTestTarget?.swiftVersion ?? SwiftLanguageVersion(string: String(ToolsVersion.currentToolsVersion.major)) ?? .v4
269-
270-
self.init(
269+
super.init(
271270
name: name,
272271
defaultLocalization: nil,
273272
platforms: platforms,
273+
type: .executable,
274274
sources: sources,
275275
dependencies: dependencies,
276-
swiftVersion: swiftVersion,
277276
buildSettings: .init()
278277
)
279278
}

0 commit comments

Comments
 (0)