@@ -28,19 +28,19 @@ import DriverSupport
2828import struct TSCBasic. ByteString
2929
3030/// Target description for a Swift target.
31- public final class SwiftTargetBuildDescription {
31+ package final class SwiftTargetBuildDescription {
3232 /// The package this target belongs to.
33- public let package : ResolvedPackage
33+ package let package : ResolvedPackage
3434
3535 /// The target described by this target.
36- public let target : ResolvedTarget
36+ package let target : ResolvedTarget
3737
3838 private let swiftTarget : SwiftTarget
3939
4040 /// The tools version of the package that declared the target. This can
4141 /// can be used to conditionalize semantically significant changes in how
4242 /// a target is built.
43- public let toolsVersion : ToolsVersion
43+ package let toolsVersion : ToolsVersion
4444
4545 /// The build parameters.
4646 let buildParameters : BuildParameters
@@ -77,22 +77,22 @@ public final class SwiftTargetBuildDescription {
7777 }
7878
7979 /// The list of all source files in the target, including the derived ones.
80- public var sources : [ AbsolutePath ] {
80+ package var sources : [ AbsolutePath ] {
8181 self . target. sources. paths + self . derivedSources. paths + self . pluginDerivedSources. paths
8282 }
8383
84- public var sourcesFileListPath : AbsolutePath {
84+ package var sourcesFileListPath : AbsolutePath {
8585 self . tempsPath. appending ( component: " sources " )
8686 }
8787
8888 /// The list of all resource files in the target, including the derived ones.
89- public var resources : [ Resource ] {
89+ package var resources : [ Resource ] {
9090 self . target. underlying. resources + self . pluginDerivedResources
9191 }
9292
9393 /// The objects in this target, containing either machine code or bitcode
9494 /// depending on the build parameters used.
95- public var objects : [ AbsolutePath ] {
95+ package var objects : [ AbsolutePath ] {
9696 get throws {
9797 let relativeSources = self . target. sources. relativePaths
9898 + self . derivedSources. relativePaths
@@ -112,7 +112,7 @@ public final class SwiftTargetBuildDescription {
112112 }
113113
114114 /// 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
116116 // If we're an executable and we're not allowing test targets to link against us, we hide the module.
117117 let triple = buildParameters. triple
118118 let allowLinkingAgainstExecutables = ( triple. isDarwin ( ) || triple. isLinux ( ) || triple. isWindows ( ) ) && self . toolsVersion >= . v5_5
@@ -133,7 +133,7 @@ public final class SwiftTargetBuildDescription {
133133 }
134134
135135 /// Path to the resource Info.plist file, if generated.
136- public private( set) var resourceBundleInfoPlistPath : AbsolutePath ?
136+ package private( set) var resourceBundleInfoPlistPath : AbsolutePath ?
137137
138138 /// Paths to the binary libraries the target depends on.
139139 var libraryBinaryPaths : Set < AbsolutePath > = [ ]
@@ -148,7 +148,7 @@ public final class SwiftTargetBuildDescription {
148148
149149 /// Describes the purpose of a test target, including any special roles such as containing a list of discovered
150150 /// tests or serving as the manifest target which contains the main entry point.
151- public enum TestTargetRole {
151+ package enum TestTargetRole {
152152 /// An ordinary test target, defined explicitly in a package, containing test code.
153153 case `default`
154154
@@ -163,10 +163,10 @@ public final class SwiftTargetBuildDescription {
163163 case entryPoint( isSynthesized: Bool )
164164 }
165165
166- public let testTargetRole : TestTargetRole ?
166+ package let testTargetRole : TestTargetRole ?
167167
168168 /// If this target is a test target.
169- public var isTestTarget : Bool {
169+ package var isTestTarget : Bool {
170170 self . testTargetRole != nil
171171 }
172172
@@ -228,13 +228,13 @@ public final class SwiftTargetBuildDescription {
228228 private( set) var moduleMap : AbsolutePath ?
229229
230230 /// The results of applying any build tool plugins to this target.
231- public let buildToolPluginInvocationResults : [ BuildToolPluginInvocationResult ]
231+ package let buildToolPluginInvocationResults : [ BuildToolPluginInvocationResult ]
232232
233233 /// The results of running any prebuild commands for this target.
234- public let prebuildCommandResults : [ PrebuildCommandResult ]
234+ package let prebuildCommandResults : [ PrebuildCommandResult ]
235235
236236 /// Any macro products that this target requires to build.
237- public let requiredMacroProducts : [ ResolvedProduct ]
237+ package let requiredMacroProducts : [ ResolvedProduct ]
238238
239239 /// ObservabilityScope with which to emit diagnostics
240240 private let observabilityScope : ObservabilityScope
@@ -474,7 +474,7 @@ public final class SwiftTargetBuildDescription {
474474 }
475475
476476 /// The arguments needed to compile this target.
477- public func compileArguments( ) throws -> [ String ] {
477+ package func compileArguments( ) throws -> [ String ] {
478478 var args = [ String] ( )
479479 args += try self . buildParameters. targetTripleArgs ( for: self . target)
480480 args += [ " -swift-version " , self . swiftVersion. rawValue]
@@ -650,7 +650,7 @@ public final class SwiftTargetBuildDescription {
650650
651651 /// When `scanInvocation` argument is set to `true`, omit the side-effect producing arguments
652652 /// 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 ] {
654654 var result : [ String ] = [ ]
655655 result. append ( self . buildParameters. toolchain. swiftCompilerPath. pathString)
656656
0 commit comments