Skip to content

Commit b70a377

Browse files
committed
XCBuildSupport: make some of the private API more public
This extends the visibility of some of the private implementation to the package level to allow use for testing without `@testable` imports.
1 parent aa7639b commit b70a377

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Sources/XCBuildSupport/PIFBuilder.swift

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import func TSCBasic.memoize
2424
import func TSCBasic.topologicalSort
2525

2626
/// The parameters required by `PIFBuilder`.
27-
struct PIFBuilderParameters {
27+
package struct PIFBuilderParameters {
2828
let triple: Basics.Triple
2929

3030
/// Whether the toolchain supports `-package-name` option.
@@ -47,6 +47,26 @@ struct PIFBuilderParameters {
4747

4848
/// The Swift language versions supported by the XCBuild being used for the buid.
4949
let supportedSwiftVersions: [SwiftLanguageVersion]
50+
51+
package init(
52+
triple: Basics.Triple,
53+
isPackageAccessModifierSupported: Bool,
54+
enableTestability: Bool,
55+
shouldCreateDylibForDynamicProducts: Bool,
56+
toolchainLibDir: AbsolutePath,
57+
pkgConfigDirectories: [AbsolutePath],
58+
sdkRootPath: AbsolutePath?,
59+
supportedSwiftVersions: [SwiftLanguageVersion]
60+
) {
61+
self.triple = triple
62+
self.isPackageAccessModifierSupported = isPackageAccessModifierSupported
63+
self.enableTestability = enableTestability
64+
self.shouldCreateDylibForDynamicProducts = shouldCreateDylibForDynamicProducts
65+
self.toolchainLibDir = toolchainLibDir
66+
self.pkgConfigDirectories = pkgConfigDirectories
67+
self.sdkRootPath = sdkRootPath
68+
self.supportedSwiftVersions = supportedSwiftVersions
69+
}
5070
}
5171

5272
/// PIF object builder for a package graph.
@@ -77,7 +97,7 @@ public final class PIFBuilder {
7797
/// - parameters: The parameters used to configure the PIF.
7898
/// - fileSystem: The file system to read from.
7999
/// - observabilityScope: The ObservabilityScope to emit diagnostics to.
80-
init(
100+
package init(
81101
graph: ModulesGraph,
82102
parameters: PIFBuilderParameters,
83103
fileSystem: FileSystem,

0 commit comments

Comments
 (0)