Skip to content

Make SwiftSDK.init available via @_spi #7482

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
Apr 23, 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
4 changes: 3 additions & 1 deletion Sources/Commands/SwiftTestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2015-2022 Apple Inc. and the Swift project authors
// Copyright (c) 2015-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -19,6 +19,8 @@ import CoreCommands
import Dispatch
import Foundation
import PackageGraph

@_spi(SwiftPMInternal)
import PackageModel

import SPMBuildCore
Expand Down
8 changes: 5 additions & 3 deletions Sources/PackageModel/SwiftSDKs/SwiftSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -156,7 +156,8 @@ public struct SwiftSDK: Equatable {
}

/// Whether or not the receiver supports testing using XCTest.
package enum XCTestSupport: Sendable, Equatable {
@_spi(SwiftPMInternal)
public enum XCTestSupport: Sendable, Equatable {
/// XCTest is supported.
case supported

Expand Down Expand Up @@ -465,7 +466,8 @@ public struct SwiftSDK: Equatable {
}

/// Creates a Swift SDK with the specified properties.
package init(
@_spi(SwiftPMInternal)
public init(
hostTriple: Triple? = nil,
targetTriple: Triple? = nil,
toolset: Toolset,
Expand Down
3 changes: 3 additions & 0 deletions Tests/BuildTests/BuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import DriverSupport
@testable import PackageGraph

import PackageLoading

@_spi(SwiftPMInternal)
@testable import PackageModel

import SPMBuildCore
import SPMTestSupport
import SwiftDriver
Expand Down
5 changes: 4 additions & 1 deletion Tests/PackageModelTests/PackageModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,10 @@
//===----------------------------------------------------------------------===//

import Basics

@_spi(SwiftPMInternal)
@testable import PackageModel

import func TSCBasic.withTemporaryFile
import XCTest

Expand Down
5 changes: 4 additions & 1 deletion Tests/PackageModelTests/SwiftSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,10 @@
//===----------------------------------------------------------------------===//

@testable import Basics

@_spi(SwiftPMInternal)
@testable import PackageModel

@testable import SPMBuildCore
import XCTest

Expand Down
7 changes: 5 additions & 2 deletions Tests/SPMBuildCoreTests/PluginInvocationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -16,7 +16,10 @@ import Basics
@testable import PackageGraph

import PackageLoading

@_spi(SwiftPMInternal)
import PackageModel

@testable import SPMBuildCore
import SPMTestSupport
import Workspace
Expand All @@ -26,7 +29,7 @@ import class TSCBasic.InMemoryFileSystem

import struct TSCUtility.SerializedDiagnostics

class PluginInvocationTests: XCTestCase {
final class PluginInvocationTests: XCTestCase {

func testBasics() throws {
// 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.
Expand Down