Skip to content

[6.0] NFC: Expose Environment with @_spi #7793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/Basics/Environment/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ extension Environment {
// MARK: - Conversions between Dictionary<String, String>

extension Environment {
package init(_ dictionary: [String: String]) {
@_spi(SwiftPMInternal)
public init(_ dictionary: [String: String]) {
self.storage = .init()
let sorted = dictionary.sorted { $0.key < $1.key }
for (key, value) in sorted {
Expand All @@ -74,7 +75,8 @@ extension Environment {
}

extension [String: String] {
package init(_ environment: Environment) {
@_spi(SwiftPMInternal)
public init(_ environment: Environment) {
self.init()
let sorted = environment.sorted { $0.key < $1.key }
for (key, value) in sorted {
Expand Down
2 changes: 2 additions & 0 deletions Sources/DriverSupport/DriverSupportUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

@_spi(SwiftPMInternal)
import Basics

import PackageModel
import SwiftDriver
import class TSCBasic.Process
Expand Down
2 changes: 2 additions & 0 deletions Sources/DriverSupport/SPMSwiftDriverExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

@_spi(SwiftPMInternal)
import Basics

import SwiftDriver

import class TSCBasic.Process
Expand Down
2 changes: 2 additions & 0 deletions Sources/SPMBuildCore/Plugins/PluginInvocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

@_spi(SwiftPMInternal)
import Basics

import Foundation
import PackageModel
import PackageLoading
Expand Down
2 changes: 2 additions & 0 deletions Sources/Workspace/DefaultPluginScriptRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

@_spi(SwiftPMInternal)
import Basics

import Foundation
import PackageGraph
import PackageModel
Expand Down
5 changes: 4 additions & 1 deletion Tests/BasicsTests/Environment/EnvironmentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
//
//===----------------------------------------------------------------------===//

@testable import Basics
@_spi(SwiftPMInternal)
@testable
import Basics

import XCTest

final class EnvironmentTests: XCTestCase {
Expand Down
1 change: 1 addition & 0 deletions Tests/SPMBuildCoreTests/PluginInvocationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_spi(SwiftPMInternal)
import Basics
@testable import PackageGraph
import PackageLoading
Expand Down