@@ -23,7 +23,7 @@ public final class SwiftTarget: Target {
23
23
}
24
24
25
25
public init ( name: String , dependencies: [ Target . Dependency ] , packageAccess: Bool , testDiscoverySrc: Sources ) {
26
- self . swiftVersion = . v5
26
+ self . toolSwiftVersion = . v5
27
27
self . declaredSwiftVersions = [ ]
28
28
29
29
super. init (
@@ -40,8 +40,8 @@ public final class SwiftTarget: Target {
40
40
)
41
41
}
42
42
43
- /// The swift version of this target.
44
- public let swiftVersion : SwiftLanguageVersion
43
+ /// The swift language version that is computed for this target based on tools version of the manifest .
44
+ public let toolSwiftVersion : SwiftLanguageVersion
45
45
46
46
/// The list of swift versions declared by the manifest.
47
47
public let declaredSwiftVersions : [ SwiftLanguageVersion ]
@@ -57,14 +57,14 @@ public final class SwiftTarget: Target {
57
57
others: [ AbsolutePath ] = [ ] ,
58
58
dependencies: [ Target . Dependency ] = [ ] ,
59
59
packageAccess: Bool ,
60
- swiftVersion : SwiftLanguageVersion ,
60
+ toolsSwiftVersion : SwiftLanguageVersion ,
61
61
declaredSwiftVersions: [ SwiftLanguageVersion ] = [ ] ,
62
62
buildSettings: BuildSettings . AssignmentTable = . init( ) ,
63
63
buildSettingsDescription: [ TargetBuildSettingDescription . Setting ] = [ ] ,
64
64
pluginUsages: [ PluginUsage ] = [ ] ,
65
65
usesUnsafeFlags: Bool
66
66
) {
67
- self . swiftVersion = swiftVersion
67
+ self . toolSwiftVersion = toolsSwiftVersion
68
68
self . declaredSwiftVersions = declaredSwiftVersions
69
69
super. init (
70
70
name: name,
@@ -103,8 +103,8 @@ public final class SwiftTarget: Target {
103
103
// We need to select the latest Swift language version that can
104
104
// satisfy the current tools version but there is not a good way to
105
105
// do that currently.
106
- self . swiftVersion = swiftTestTarget?
107
- . swiftVersion ?? SwiftLanguageVersion ( string: String ( SwiftVersion . current. major) ) ?? . v4
106
+ self . toolSwiftVersion = swiftTestTarget?
107
+ . toolSwiftVersion ?? SwiftLanguageVersion ( string: String ( SwiftVersion . current. major) ) ?? . v4
108
108
self . declaredSwiftVersions = [ ]
109
109
let sources = Sources ( paths: [ testEntryPointPath] , root: testEntryPointPath. parentDirectory)
110
110
@@ -129,14 +129,14 @@ public final class SwiftTarget: Target {
129
129
130
130
override public func encode( to encoder: Encoder ) throws {
131
131
var container = encoder. container ( keyedBy: CodingKeys . self)
132
- try container. encode ( self . swiftVersion , forKey: . swiftVersion)
132
+ try container. encode ( self . toolSwiftVersion , forKey: . swiftVersion)
133
133
try container. encode ( self . declaredSwiftVersions, forKey: . declaredSwiftVersions)
134
134
try super. encode ( to: encoder)
135
135
}
136
136
137
137
public required init ( from decoder: Decoder ) throws {
138
138
let container = try decoder. container ( keyedBy: CodingKeys . self)
139
- self . swiftVersion = try container. decode ( SwiftLanguageVersion . self, forKey: . swiftVersion)
139
+ self . toolSwiftVersion = try container. decode ( SwiftLanguageVersion . self, forKey: . swiftVersion)
140
140
self . declaredSwiftVersions = try container. decode ( [ SwiftLanguageVersion ] . self, forKey: . declaredSwiftVersions)
141
141
try super. init ( from: decoder)
142
142
}
0 commit comments