Skip to content
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
3 changes: 2 additions & 1 deletion Sources/swift-experimental-sdk/Entrypoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
//===----------------------------------------------------------------------===//

import SwiftSDKCommand
import Foundation

@main
struct Entrypoint {
static func main() async {
print("warning: `swift experimental-sdk` command is deprecated and will be removed in a future version of SwiftPM. Use `swift sdk` instead.")
fputs("warning: `swift experimental-sdk` command is deprecated and will be removed in a future version of SwiftPM. Use `swift sdk` instead.", stderr)
await SwiftSDKCommand.main()
}
}
4 changes: 2 additions & 2 deletions Sources/swift-package-manager/SwiftPM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import Basics

import Commands

import Foundation
import SwiftSDKCommand
import PackageCollectionsCommand
import PackageRegistryCommand
Expand Down Expand Up @@ -42,7 +42,7 @@ struct SwiftPM {
case "swift-build":
await SwiftBuildCommand.main()
case "swift-experimental-sdk":
print("warning: `swift experimental-sdk` command is deprecated and will be removed in a future version of SwiftPM. Use `swift sdk` instead.")
fputs("warning: `swift experimental-sdk` command is deprecated and will be removed in a future version of SwiftPM. Use `swift sdk` instead.", stderr)
fallthrough
case "swift-sdk":
await SwiftSDKCommand.main()
Expand Down
19 changes: 9 additions & 10 deletions Tests/CommandsTests/SDKCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ final class SDKCommandTests: CommandsTestCase {
)

if command == .experimentalSDK {
XCTAssertMatch(stdout, .contains(deprecationWarning))
XCTAssertMatch(stderr, .contains(deprecationWarning))
XCTAssertNoMatch(stdout, .contains(deprecationWarning))
}

// We only expect tool's output on the stdout stream.
Expand All @@ -57,18 +58,16 @@ final class SDKCommandTests: CommandsTestCase {
.contains("\(bundle)` successfully installed as test-sdk.artifactbundle.")
)

XCTAssertEqual(stderr.count, 0)

(stdout, stderr) = try command.execute(
["list", "--swift-sdks-path", fixturePath.pathString])

if command == .experimentalSDK {
XCTAssertMatch(stdout, .contains(deprecationWarning))
XCTAssertMatch(stderr, .contains(deprecationWarning))
XCTAssertNoMatch(stdout, .contains(deprecationWarning))
}

// We only expect tool's output on the stdout stream.
XCTAssertMatch(stdout, .contains("test-artifact"))
XCTAssertEqual(stderr.count, 0)

XCTAssertThrowsError(try command.execute(
[
Expand All @@ -91,30 +90,30 @@ final class SDKCommandTests: CommandsTestCase {
}

if command == .experimentalSDK {
XCTAssertMatch(stdout, .contains(deprecationWarning))
XCTAssertMatch(stderr, .contains(deprecationWarning))
}

(stdout, stderr) = try command.execute(
["remove", "--swift-sdks-path", fixturePath.pathString, "test-artifact"])

if command == .experimentalSDK {
XCTAssertMatch(stdout, .contains(deprecationWarning))
XCTAssertMatch(stderr, .contains(deprecationWarning))
XCTAssertNoMatch(stdout, .contains(deprecationWarning))
}

// We only expect tool's output on the stdout stream.
XCTAssertMatch(stdout, .contains("test-sdk.artifactbundle` was successfully removed from the file system."))
XCTAssertEqual(stderr.count, 0)

(stdout, stderr) = try command.execute(
["list", "--swift-sdks-path", fixturePath.pathString])

if command == .experimentalSDK {
XCTAssertMatch(stdout, .contains(deprecationWarning))
XCTAssertMatch(stderr, .contains(deprecationWarning))
XCTAssertNoMatch(stdout, .contains(deprecationWarning))
}

// We only expect tool's output on the stdout stream.
XCTAssertNoMatch(stdout, .contains("test-artifact"))
XCTAssertEqual(stderr.count, 0)
}
}
}
Expand Down