Skip to content

Commit 22b4323

Browse files
authored
[6.0] Make SwiftSDK.init available via @_spi (#7487)
Cherry-pick of #7482. **Explanation**: This initializer is an internal implementation detail that should only be available via `@_spi`. **Scope**: Isolated to the `SwiftSDK` type, no functional change. **Risk**: very low, no functional change. **Testing**: no functional change, CI passing. **Issue**: N/A **Reviewer**: @bnbarham
1 parent bdcf9a1 commit 22b4323

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

Sources/Commands/SwiftTestCommand.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2015-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2015-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -19,6 +19,8 @@ import CoreCommands
1919
import Dispatch
2020
import Foundation
2121
import PackageGraph
22+
23+
@_spi(SwiftPMInternal)
2224
import PackageModel
2325

2426
import SPMBuildCore

Sources/PackageModel/SwiftSDKs/SwiftSDK.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -156,7 +156,8 @@ public struct SwiftSDK: Equatable {
156156
}
157157

158158
/// Whether or not the receiver supports testing using XCTest.
159-
package enum XCTestSupport: Sendable, Equatable {
159+
@_spi(SwiftPMInternal)
160+
public enum XCTestSupport: Sendable, Equatable {
160161
/// XCTest is supported.
161162
case supported
162163

@@ -465,7 +466,8 @@ public struct SwiftSDK: Equatable {
465466
}
466467

467468
/// Creates a Swift SDK with the specified properties.
468-
package init(
469+
@_spi(SwiftPMInternal)
470+
public init(
469471
hostTriple: Triple? = nil,
470472
targetTriple: Triple? = nil,
471473
toolset: Toolset,

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ import DriverSupport
1818

1919
@testable import PackageGraph
2020
import PackageLoading
21+
22+
@_spi(SwiftPMInternal)
2123
@testable import PackageModel
24+
2225
import SPMBuildCore
2326
import SPMTestSupport
2427
import SwiftDriver

Tests/PackageModelTests/PackageModelTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -11,7 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Basics
14+
15+
@_spi(SwiftPMInternal)
1416
@testable import PackageModel
17+
1518
import func TSCBasic.withTemporaryFile
1619
import XCTest
1720

Tests/PackageModelTests/SwiftSDKTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -11,7 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14+
15+
@_spi(SwiftPMInternal)
1416
@testable import PackageModel
17+
1518
@testable import SPMBuildCore
1619
import XCTest
1720

Tests/SPMBuildCoreTests/PluginInvocationTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -13,7 +13,10 @@
1313
import Basics
1414
@testable import PackageGraph
1515
import PackageLoading
16+
17+
@_spi(SwiftPMInternal)
1618
import PackageModel
19+
1720
@testable import SPMBuildCore
1821
import SPMTestSupport
1922
import Workspace
@@ -23,7 +26,7 @@ import class TSCBasic.InMemoryFileSystem
2326

2427
import struct TSCUtility.SerializedDiagnostics
2528

26-
class PluginInvocationTests: XCTestCase {
29+
final class PluginInvocationTests: XCTestCase {
2730

2831
func testBasics() throws {
2932
// Construct a canned file system and package graph with a single package and a library that uses a build tool plugin that invokes a tool.

0 commit comments

Comments
 (0)