@@ -28,19 +28,19 @@ import DriverSupport
28
28
import struct TSCBasic. ByteString
29
29
30
30
/// Target description for a Swift target.
31
- public final class SwiftTargetBuildDescription {
31
+ package final class SwiftTargetBuildDescription {
32
32
/// The package this target belongs to.
33
- public let package : ResolvedPackage
33
+ package let package : ResolvedPackage
34
34
35
35
/// The target described by this target.
36
- public let target : ResolvedTarget
36
+ package let target : ResolvedTarget
37
37
38
38
private let swiftTarget : SwiftTarget
39
39
40
40
/// The tools version of the package that declared the target. This can
41
41
/// can be used to conditionalize semantically significant changes in how
42
42
/// a target is built.
43
- public let toolsVersion : ToolsVersion
43
+ package let toolsVersion : ToolsVersion
44
44
45
45
/// The build parameters.
46
46
let buildParameters : BuildParameters
@@ -77,22 +77,22 @@ public final class SwiftTargetBuildDescription {
77
77
}
78
78
79
79
/// The list of all source files in the target, including the derived ones.
80
- public var sources : [ AbsolutePath ] {
80
+ package var sources : [ AbsolutePath ] {
81
81
self . target. sources. paths + self . derivedSources. paths + self . pluginDerivedSources. paths
82
82
}
83
83
84
- public var sourcesFileListPath : AbsolutePath {
84
+ package var sourcesFileListPath : AbsolutePath {
85
85
self . tempsPath. appending ( component: " sources " )
86
86
}
87
87
88
88
/// The list of all resource files in the target, including the derived ones.
89
- public var resources : [ Resource ] {
89
+ package var resources : [ Resource ] {
90
90
self . target. underlying. resources + self . pluginDerivedResources
91
91
}
92
92
93
93
/// The objects in this target, containing either machine code or bitcode
94
94
/// depending on the build parameters used.
95
- public var objects : [ AbsolutePath ] {
95
+ package var objects : [ AbsolutePath ] {
96
96
get throws {
97
97
let relativeSources = self . target. sources. relativePaths
98
98
+ self . derivedSources. relativePaths
@@ -112,7 +112,7 @@ public final class SwiftTargetBuildDescription {
112
112
}
113
113
114
114
/// The path to the swiftmodule file after compilation.
115
- public var moduleOutputPath : AbsolutePath { // note: needs to be public because of sourcekit-lsp
115
+ public var moduleOutputPath : AbsolutePath { // note: needs to be ` public` because of sourcekit-lsp
116
116
// If we're an executable and we're not allowing test targets to link against us, we hide the module.
117
117
let triple = buildParameters. triple
118
118
let allowLinkingAgainstExecutables = ( triple. isDarwin ( ) || triple. isLinux ( ) || triple. isWindows ( ) ) && self . toolsVersion >= . v5_5
@@ -133,7 +133,7 @@ public final class SwiftTargetBuildDescription {
133
133
}
134
134
135
135
/// Path to the resource Info.plist file, if generated.
136
- public private( set) var resourceBundleInfoPlistPath : AbsolutePath ?
136
+ package private( set) var resourceBundleInfoPlistPath : AbsolutePath ?
137
137
138
138
/// Paths to the binary libraries the target depends on.
139
139
var libraryBinaryPaths : Set < AbsolutePath > = [ ]
@@ -148,7 +148,7 @@ public final class SwiftTargetBuildDescription {
148
148
149
149
/// Describes the purpose of a test target, including any special roles such as containing a list of discovered
150
150
/// tests or serving as the manifest target which contains the main entry point.
151
- public enum TestTargetRole {
151
+ package enum TestTargetRole {
152
152
/// An ordinary test target, defined explicitly in a package, containing test code.
153
153
case `default`
154
154
@@ -163,10 +163,10 @@ public final class SwiftTargetBuildDescription {
163
163
case entryPoint( isSynthesized: Bool )
164
164
}
165
165
166
- public let testTargetRole : TestTargetRole ?
166
+ package let testTargetRole : TestTargetRole ?
167
167
168
168
/// If this target is a test target.
169
- public var isTestTarget : Bool {
169
+ package var isTestTarget : Bool {
170
170
self . testTargetRole != nil
171
171
}
172
172
@@ -228,13 +228,13 @@ public final class SwiftTargetBuildDescription {
228
228
private( set) var moduleMap : AbsolutePath ?
229
229
230
230
/// The results of applying any build tool plugins to this target.
231
- public let buildToolPluginInvocationResults : [ BuildToolPluginInvocationResult ]
231
+ package let buildToolPluginInvocationResults : [ BuildToolPluginInvocationResult ]
232
232
233
233
/// The results of running any prebuild commands for this target.
234
- public let prebuildCommandResults : [ PrebuildCommandResult ]
234
+ package let prebuildCommandResults : [ PrebuildCommandResult ]
235
235
236
236
/// Any macro products that this target requires to build.
237
- public let requiredMacroProducts : [ ResolvedProduct ]
237
+ package let requiredMacroProducts : [ ResolvedProduct ]
238
238
239
239
/// ObservabilityScope with which to emit diagnostics
240
240
private let observabilityScope : ObservabilityScope
@@ -474,7 +474,7 @@ public final class SwiftTargetBuildDescription {
474
474
}
475
475
476
476
/// The arguments needed to compile this target.
477
- public func compileArguments( ) throws -> [ String ] {
477
+ package func compileArguments( ) throws -> [ String ] {
478
478
var args = [ String] ( )
479
479
args += try self . buildParameters. targetTripleArgs ( for: self . target)
480
480
args += [ " -swift-version " , self . swiftVersion. rawValue]
@@ -650,7 +650,7 @@ public final class SwiftTargetBuildDescription {
650
650
651
651
/// When `scanInvocation` argument is set to `true`, omit the side-effect producing arguments
652
652
/// such as emitting a module or supplementary outputs.
653
- public func emitCommandLine( scanInvocation: Bool = false ) throws -> [ String ] {
653
+ package func emitCommandLine( scanInvocation: Bool = false ) throws -> [ String ] {
654
654
var result : [ String ] = [ ]
655
655
result. append ( self . buildParameters. toolchain. swiftCompilerPath. pathString)
656
656
0 commit comments