Skip to content

Commit b46e02a

Browse files
authored
[6.0] NFC: Expose Environment with @_spi (#7793)
Cherry-pick of #7780. **Explanation**: Initializers for this type should be available via `@_spi` for clients to consume. **Scope**: Limited to a single type and relevant initializers. **Risk**: Very low, change is NFC. **Testing**: Verified through existing test suite. **Issue**: rdar://131407852 **Reviewer**: @bnbarham
1 parent a087542 commit b46e02a

File tree

7 files changed

+17
-3
lines changed

7 files changed

+17
-3
lines changed

Sources/Basics/Environment/Environment.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ extension Environment {
6464
// MARK: - Conversions between Dictionary<String, String>
6565

6666
extension Environment {
67-
package init(_ dictionary: [String: String]) {
67+
@_spi(SwiftPMInternal)
68+
public init(_ dictionary: [String: String]) {
6869
self.storage = .init()
6970
let sorted = dictionary.sorted { $0.key < $1.key }
7071
for (key, value) in sorted {
@@ -74,7 +75,8 @@ extension Environment {
7475
}
7576

7677
extension [String: String] {
77-
package init(_ environment: Environment) {
78+
@_spi(SwiftPMInternal)
79+
public init(_ environment: Environment) {
7880
self.init()
7981
let sorted = environment.sorted { $0.key < $1.key }
8082
for (key, value) in sorted {

Sources/DriverSupport/DriverSupportUtils.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(SwiftPMInternal)
1314
import Basics
15+
1416
import PackageModel
1517
import SwiftDriver
1618
import class TSCBasic.Process

Sources/DriverSupport/SPMSwiftDriverExecutor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(SwiftPMInternal)
1314
import Basics
15+
1416
import SwiftDriver
1517

1618
import class TSCBasic.Process

Sources/SPMBuildCore/Plugins/PluginInvocation.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(SwiftPMInternal)
1314
import Basics
15+
1416
import Foundation
1517
import PackageModel
1618
import PackageLoading

Sources/Workspace/DefaultPluginScriptRunner.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(SwiftPMInternal)
1314
import Basics
15+
1416
import Foundation
1517
import PackageGraph
1618
import PackageModel

Tests/BasicsTests/Environment/EnvironmentTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@testable import Basics
13+
@_spi(SwiftPMInternal)
14+
@testable
15+
import Basics
16+
1417
import XCTest
1518

1619
final class EnvironmentTests: XCTestCase {

Tests/SPMBuildCoreTests/PluginInvocationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(SwiftPMInternal)
1314
import Basics
1415
@testable import PackageGraph
1516
import PackageLoading

0 commit comments

Comments
 (0)