Skip to content

Commit 26b5f86

Browse files
committed
Move UserToolchain and Destination
Purpose of this is to make libSwift easier to use for parsing manifests.
1 parent 53e0734 commit 26b5f86

File tree

13 files changed

+37
-5
lines changed

13 files changed

+37
-5
lines changed

Sources/Commands/SwiftTestTool.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Basic
1414
import Build
1515
import Utility
1616
import PackageGraph
17+
import Workspace
1718

1819
import func POSIX.exit
1920

Sources/TestSupport/Resources.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Build
1313
import Foundation
1414
import Commands
1515
import PackageLoading
16+
import Workspace
1617

1718
#if os(macOS)
1819
private func bundleRoot() -> AbsolutePath {

Sources/Workspace/Error.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
This source file is part of the Swift.org open source project
3+
4+
Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+
See http://swift.org/LICENSE.txt for license information
8+
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
9+
*/
10+
11+
enum Error: Swift.Error {
12+
/// Couldn't find all tools needed by the package manager.
13+
case invalidToolchain(problem: String)
14+
}
15+
16+
extension Error: CustomStringConvertible {
17+
var description: String {
18+
switch self {
19+
case .invalidToolchain(let problem):
20+
return problem
21+
}
22+
}
23+
}

Sources/Commands/UserToolchain.swift renamed to Sources/Workspace/UserToolchain.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ public final class UserToolchain: Toolchain {
6161
/// Path to the xctest utility.
6262
///
6363
/// This is only present on macOS.
64-
let xctest: AbsolutePath?
64+
public let xctest: AbsolutePath?
6565

6666
/// Path to llbuild.
67-
let llbuild: AbsolutePath
67+
public let llbuild: AbsolutePath
6868

6969
/// The compilation destination object.
70-
let destination: Destination
70+
public let destination: Destination
7171

7272
/// Search paths from the PATH environment variable.
7373
let envSearchPaths: [AbsolutePath]
7474

7575
/// Returns the runtime library for the given sanitizer.
76-
func runtimeLibrary(for sanitizer: Sanitizer) throws -> AbsolutePath {
76+
public func runtimeLibrary(for sanitizer: Sanitizer) throws -> AbsolutePath {
7777
// FIXME: This is only for SwiftPM development time support. It is OK
7878
// for now but we shouldn't need to resolve the symlink. We need to lay
7979
// down symlinks to runtimes in our fake toolchain as part of the

Tests/CommandsTests/BuildToolTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import XCTest
1313
import TestSupport
1414
import Basic
1515
import Commands
16+
import Workspace
1617

1718
struct BuildResult {
1819
let output: String

Tests/FunctionalPerformanceTests/BuildPerfTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Commands
1313
import TestSupport
1414
import Basic
1515
import Utility
16+
import Workspace
1617

1718
class BuildPerfTests: XCTestCasePerf {
1819

Tests/FunctionalTests/CFamilyTargetTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Basic
1515
import PackageModel
1616
import SourceControl
1717
import Utility
18+
import Workspace
1819

1920
typealias Process = Basic.Process
2021

Tests/FunctionalTests/DependencyResolutionTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Basic
1414
import Commands
1515
import TestSupport
1616
import SourceControl
17+
import Workspace
1718

1819
class DependencyResolutionTests: XCTestCase {
1920
func testInternalSimple() {

Tests/FunctionalTests/MiscellaneousTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import XCTest
1212
import TestSupport
1313
import Basic
14-
import struct Commands.Destination
1514
import PackageModel
1615
import Utility
1716
import SPMLibc
1817
import class Foundation.ProcessInfo
18+
import Workspace
1919

2020
typealias ProcessID = Basic.Process.ProcessID
2121

Tests/FunctionalTests/ModuleMapTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Commands
1313
import TestSupport
1414
import Basic
1515
import Utility
16+
import Workspace
1617

1718
class ModuleMapsTestCase: XCTestCase {
1819

Tests/FunctionalTests/SwiftPMXCTestHelperTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import TestSupport
1313
import XCTest
1414
import Utility
1515
import Commands
16+
import Workspace
1617

1718
class SwiftPMXCTestHelperTests: XCTestCase {
1819
func testBasicXCTestHelper() {

Tests/FunctionalTests/ToolsVersionTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import TestSupport
1616
import Commands
1717
import PackageModel
1818
import SourceControl
19+
import Workspace
1920

2021
class ToolsVersionTests: XCTestCase {
2122

0 commit comments

Comments
 (0)