From 7f697fa14a815cfc66d808213dc843adb42b04af Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Fri, 1 Feb 2019 16:45:59 -0800 Subject: [PATCH] [swiftpm] Update to latest master * import Utility -> import SPMUtility * AbsolutePath.asString -> path.description or "\(path)" --- Package.resolved | 4 +- Sources/SKCore/BuildSetup.swift | 2 +- .../CompilationDatabaseBuildSystem.swift | 2 +- Sources/SKCore/FallbackBuildSystem.swift | 10 ++-- Sources/SKCore/Toolchain.swift | 4 +- Sources/SKCore/ToolchainRegistry.swift | 2 +- Sources/SKSupport/BuildConfiguration.swift | 2 +- Sources/SKSupport/LogLevel.swift | 2 +- Sources/SKSupport/Platform.swift | 2 +- .../SKSwiftPMWorkspace/SwiftPMWorkspace.swift | 32 ++++++------- Sources/SKTestSupport/TestServer.swift | 2 +- Sources/SourceKit/SourceKitServer.swift | 4 +- Sources/SourceKit/Workspace.swift | 11 +++-- .../clangd/ClangLanguageServer.swift | 2 +- .../sourcekitd/SwiftSourceKitFramework.swift | 2 +- Sources/sourcekit-lsp/main.swift | 2 +- .../FallbackBuildSystemTests.swift | 18 ++++---- .../SKCoreTests/ToolchainRegistryTests.swift | 22 ++++----- .../SwiftPMWorkspaceTests.swift | 46 ++++++++++--------- 19 files changed, 89 insertions(+), 82 deletions(-) diff --git a/Package.resolved b/Package.resolved index 3da6db25..76a472ca 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,7 +15,7 @@ "repositoryURL": "https://github.com/apple/swift-llbuild.git", "state": { "branch": "master", - "revision": "b8f6f852ec5f1cd968c4d662106e3d6ecdc146a7", + "revision": "4e25396f00759d3d781d888ac6b9a0118b5dbe44", "version": null } }, @@ -24,7 +24,7 @@ "repositoryURL": "https://github.com/apple/swift-package-manager.git", "state": { "branch": "master", - "revision": "b7d64a338a21bf2164d0d94ecc69f33cc0f7856c", + "revision": "9b6be668d93829f9ef0727ad2d2490e56487fedc", "version": null } } diff --git a/Sources/SKCore/BuildSetup.swift b/Sources/SKCore/BuildSetup.swift index 986d6c7d..3b1c134c 100644 --- a/Sources/SKCore/BuildSetup.swift +++ b/Sources/SKCore/BuildSetup.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// import Basic -import Utility +import SPMUtility import SKSupport /// Build configuration diff --git a/Sources/SKCore/CompilationDatabaseBuildSystem.swift b/Sources/SKCore/CompilationDatabaseBuildSystem.swift index 03073788..ec24866c 100644 --- a/Sources/SKCore/CompilationDatabaseBuildSystem.swift +++ b/Sources/SKCore/CompilationDatabaseBuildSystem.swift @@ -69,7 +69,7 @@ extension CompilationDatabaseBuildSystem: BuildSystem { } if compdb == nil { - log("could not open compilation database for \(path.asString)", level: .warning) + log("could not open compilation database for \(path)", level: .warning) } return compdb diff --git a/Sources/SKCore/FallbackBuildSystem.swift b/Sources/SKCore/FallbackBuildSystem.swift index 1e838e8e..18bce8e1 100644 --- a/Sources/SKCore/FallbackBuildSystem.swift +++ b/Sources/SKCore/FallbackBuildSystem.swift @@ -12,7 +12,7 @@ import LanguageServerProtocol import Basic -import enum Utility.Platform +import enum SPMUtility.Platform /// A simple BuildSystem suitable as a fallback when accurate settings are unknown. public final class FallbackBuildSystem: BuildSystem { @@ -53,10 +53,10 @@ public final class FallbackBuildSystem: BuildSystem { if let sdkpath = sdkpath { args += [ "-sdk", - sdkpath.asString, + sdkpath.description, ] } - args.append(path.asString) + args.append(path.description) return FileBuildSettings(preferredToolchain: nil, compilerArguments: args) } @@ -65,10 +65,10 @@ public final class FallbackBuildSystem: BuildSystem { if let sdkpath = sdkpath { args += [ "-isysroot", - sdkpath.asString, + sdkpath.description, ] } - args.append(path.asString) + args.append(path.description) return FileBuildSettings(preferredToolchain: nil, compilerArguments: args) } } diff --git a/Sources/SKCore/Toolchain.swift b/Sources/SKCore/Toolchain.swift index 006fe118..b036d2d5 100644 --- a/Sources/SKCore/Toolchain.swift +++ b/Sources/SKCore/Toolchain.swift @@ -12,7 +12,7 @@ import SKSupport import Basic -import Utility +import SPMUtility /// A Toolchain is a collection of related compilers and libraries meant to be used together to /// build and edit source code. @@ -107,7 +107,7 @@ extension Toolchain { path: path) } else { self.init( - identifier: path.asString, + identifier: path.description, displayName: path.basename, path: path) } diff --git a/Sources/SKCore/ToolchainRegistry.swift b/Sources/SKCore/ToolchainRegistry.swift index fa2d2ae2..3a313963 100644 --- a/Sources/SKCore/ToolchainRegistry.swift +++ b/Sources/SKCore/ToolchainRegistry.swift @@ -12,7 +12,7 @@ import SKSupport import Basic -import Utility +import SPMUtility import Dispatch import POSIX import Foundation diff --git a/Sources/SKSupport/BuildConfiguration.swift b/Sources/SKSupport/BuildConfiguration.swift index de90a250..c9fba7eb 100644 --- a/Sources/SKSupport/BuildConfiguration.swift +++ b/Sources/SKSupport/BuildConfiguration.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -import Utility +import SPMUtility public enum BuildConfiguration: String { case debug diff --git a/Sources/SKSupport/LogLevel.swift b/Sources/SKSupport/LogLevel.swift index c93569c4..2660b818 100644 --- a/Sources/SKSupport/LogLevel.swift +++ b/Sources/SKSupport/LogLevel.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -import Utility +import SPMUtility #if canImport(os) import os diff --git a/Sources/SKSupport/Platform.swift b/Sources/SKSupport/Platform.swift index c97efb9f..1797e2c7 100644 --- a/Sources/SKSupport/Platform.swift +++ b/Sources/SKSupport/Platform.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -import Utility +import SPMUtility extension Platform { diff --git a/Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift b/Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift index 8aa4692d..9d6a86bb 100644 --- a/Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift +++ b/Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift @@ -13,7 +13,7 @@ import LanguageServerProtocol import SKCore import Basic -import Utility +import SPMUtility import SKSupport import Build import PackageModel @@ -95,14 +95,14 @@ public final class SwiftPMWorkspace { var extraSwiftFlags: [String] = [] var extraClangFlags: [String] = [] if let sdk = sdk { - extraSwiftFlags += ["-sdk", sdk.asString] - extraClangFlags += ["-isysroot", sdk.asString] + extraSwiftFlags += ["-sdk", sdk.description] + extraClangFlags += ["-isysroot", sdk.description] } if let platformPath = platformPath { let flags = [ "-F", - platformPath.appending(components: "Developer", "Library", "Frameworks").asString + platformPath.appending(components: "Developer", "Library", "Frameworks").description ] extraSwiftFlags += flags extraClangFlags += flags @@ -159,7 +159,7 @@ public final class SwiftPMWorkspace { fileSystem: localFileSystem, buildSetup: buildSetup) } catch Error.noManifest(let path) { - log("could not find manifest, or not a SwiftPM package: \(path.asString)", level: .warning) + log("could not find manifest, or not a SwiftPM package: \(path)", level: .warning) return nil } catch { log("failed to create \(SwiftPMWorkspace.self): \(error)", level: .error) @@ -277,7 +277,7 @@ extension SwiftPMWorkspace { /// Retrieve settings for a package manifest (Package.swift). func settings(forPackageManifest path: AbsolutePath) -> FileBuildSettings? { for package in packageGraph.packages where path == package.manifest.path { - let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.asString] + let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.description] return FileBuildSettings( preferredToolchain: nil, compilerArguments: compilerArgs @@ -311,21 +311,21 @@ extension SwiftPMWorkspace { "-emit-dependencies", "-emit-module", "-emit-module-path", - buildPath.appending(component: "\(td.target.c99name).swiftmodule").asString, + buildPath.appending(component: "\(td.target.c99name).swiftmodule").description // -output-file-map ] if td.target.type == .library || td.target.type == .test { args += ["-parse-as-library"] } args += ["-c"] - args += td.target.sources.paths.map { $0.asString } - args += ["-I", buildPath.asString] + args += td.target.sources.paths.map { $0.description } + args += ["-I", buildPath.description] args += td.compileArguments() return FileBuildSettings( preferredToolchain: nil, compilerArguments: args, - workingDirectory: workspacePath.asString) + workingDirectory: workspacePath.description) } /// Retrieve settings for the given C-family language file, which is part of a known target build @@ -348,7 +348,7 @@ extension SwiftPMWorkspace { "-MT", "dependencies", "-MF", - compilePath.deps.asString, + compilePath.deps.description, ] } @@ -368,27 +368,27 @@ extension SwiftPMWorkspace { if let compilePath = compilePath { args += [ "-c", - compilePath.source.asString, + compilePath.source.description, "-o", - compilePath.object.asString + compilePath.object.description ] } else if path.extension == "h" { args += ["-c"] if let xflag = language.xflagHeader { args += ["-x", xflag] } - args += [path.asString] + args += [path.description] } else { args += [ "-c", - path.asString, + path.description, ] } return FileBuildSettings( preferredToolchain: nil, compilerArguments: args, - workingDirectory: workspacePath.asString) + workingDirectory: workspacePath.description) } } diff --git a/Sources/SKTestSupport/TestServer.swift b/Sources/SKTestSupport/TestServer.swift index 0041e98f..b34e2106 100644 --- a/Sources/SKTestSupport/TestServer.swift +++ b/Sources/SKTestSupport/TestServer.swift @@ -12,7 +12,7 @@ import SKSupport import SKCore -import Utility +import SPMUtility import LanguageServerProtocol import LanguageServerProtocolJSONRPC import SourceKit diff --git a/Sources/SourceKit/SourceKitServer.swift b/Sources/SourceKit/SourceKitServer.swift index 35393f4b..747226f6 100644 --- a/Sources/SourceKit/SourceKitServer.swift +++ b/Sources/SourceKit/SourceKitServer.swift @@ -15,7 +15,7 @@ import SKCore import SKSupport import IndexStoreDB import Basic -import Utility +import SPMUtility import Dispatch import Foundation import SPMLibc @@ -172,7 +172,7 @@ public final class SourceKitServer: LanguageServer { let resp = try service.sendSync(InitializeRequest( processId: Int(getpid()), rootPath: nil, - rootURL: (workspace?.rootPath).map { URL(fileURLWithPath: $0.asString) }, + rootURL: (workspace?.rootPath).map { URL(fileURLWithPath: $0.description) }, initializationOptions: InitializationOptions(), capabilities: workspace?.clientCapabilities ?? ClientCapabilities(workspace: nil, textDocument: nil), trace: .off, diff --git a/Sources/SourceKit/Workspace.swift b/Sources/SourceKit/Workspace.swift index 8160230f..0a98441e 100644 --- a/Sources/SourceKit/Workspace.swift +++ b/Sources/SourceKit/Workspace.swift @@ -15,7 +15,7 @@ import SKCore import SKSupport import IndexStoreDB import Basic -import Utility +import SPMUtility import SKSwiftPMWorkspace /// Represents the configuration and sate of a project or combination of projects being worked on @@ -95,9 +95,12 @@ public final class Workspace { let libPath = toolchainRegistry.default?.libIndexStore { do { - let lib = try IndexStoreLibrary(dylibPath: libPath.asString) - self.index = try IndexStoreDB(storePath: storePath.asString, databasePath: dbPath.asString, library: lib) - log("opened IndexStoreDB at \(dbPath.asString) with store path \(storePath.asString)") + let lib = try IndexStoreLibrary(dylibPath: libPath.description) + self.index = try IndexStoreDB( + storePath: storePath.description, + databasePath: dbPath.description, + library: lib) + log("opened IndexStoreDB at \(dbPath) with store path \(storePath)") } catch { log("failed to open IndexStoreDB: \(error.localizedDescription)", level: .error) } diff --git a/Sources/SourceKit/clangd/ClangLanguageServer.swift b/Sources/SourceKit/clangd/ClangLanguageServer.swift index 849618ff..8f1d4530 100644 --- a/Sources/SourceKit/clangd/ClangLanguageServer.swift +++ b/Sources/SourceKit/clangd/ClangLanguageServer.swift @@ -149,7 +149,7 @@ func makeJSONRPCClangServer(client: MessageHandler, clangd: AbsolutePath, buildS if #available(OSX 10.13, *) { process.executableURL = clangd.asURL } else { - process.launchPath = clangd.asString + process.launchPath = clangd.description } process.arguments = [ diff --git a/Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift b/Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift index 4bce033a..c4131b18 100644 --- a/Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift +++ b/Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift @@ -42,7 +42,7 @@ final class SwiftSourceKitFramework { init(dylib path: AbsolutePath) throws { self.path = path - self.dylib = try dlopen(path.asString, mode: [.lazy, .local, .first, .deepBind]) + self.dylib = try dlopen(path.description, mode: [.lazy, .local, .first, .deepBind]) func dlsym_required(_ handle: DLHandle, symbol: String) throws -> T { guard let sym: T = dlsym(handle, symbol: symbol) else { diff --git a/Sources/sourcekit-lsp/main.swift b/Sources/sourcekit-lsp/main.swift index e6d3e713..120a2c58 100644 --- a/Sources/sourcekit-lsp/main.swift +++ b/Sources/sourcekit-lsp/main.swift @@ -18,7 +18,7 @@ import SKCore import SPMLibc import Dispatch import Basic -import Utility +import SPMUtility import Foundation import sourcekitd // Not needed here, but fixes debugging... diff --git a/Tests/SKCoreTests/FallbackBuildSystemTests.swift b/Tests/SKCoreTests/FallbackBuildSystemTests.swift index 8b99f228..6ba9a7f1 100644 --- a/Tests/SKCoreTests/FallbackBuildSystemTests.swift +++ b/Tests/SKCoreTests/FallbackBuildSystemTests.swift @@ -34,14 +34,14 @@ final class FallbackBuildSystemTests: XCTestCase { let args = settings.compilerArguments XCTAssertEqual(args, [ "-sdk", - sdk.asString, - source.asString, + sdk.description, + source.description, ]) bs.sdkpath = nil XCTAssertEqual(bs.settings(for: source.asURL, .swift)?.compilerArguments, [ - source.asString, + source.description, ]) } @@ -59,14 +59,14 @@ final class FallbackBuildSystemTests: XCTestCase { let args = settings.compilerArguments XCTAssertEqual(args, [ "-isysroot", - sdk.asString, - source.asString, + sdk.description, + source.description, ]) bs.sdkpath = nil XCTAssertEqual(bs.settings(for: source.asURL, .cpp)?.compilerArguments, [ - source.asString, + source.description, ]) } @@ -75,7 +75,7 @@ final class FallbackBuildSystemTests: XCTestCase { let bs = FallbackBuildSystem() bs.sdkpath = nil XCTAssertEqual(bs.settings(for: source.asURL, .c)?.compilerArguments, [ - source.asString, + source.description, ]) } @@ -84,7 +84,7 @@ final class FallbackBuildSystemTests: XCTestCase { let bs = FallbackBuildSystem() bs.sdkpath = nil XCTAssertEqual(bs.settings(for: source.asURL, .objective_c)?.compilerArguments, [ - source.asString, + source.description, ]) } @@ -93,7 +93,7 @@ final class FallbackBuildSystemTests: XCTestCase { let bs = FallbackBuildSystem() bs.sdkpath = nil XCTAssertEqual(bs.settings(for: source.asURL, .objective_cpp)?.compilerArguments, [ - source.asString, + source.description, ]) } diff --git a/Tests/SKCoreTests/ToolchainRegistryTests.swift b/Tests/SKCoreTests/ToolchainRegistryTests.swift index c6bf8f94..3171e86e 100644 --- a/Tests/SKCoreTests/ToolchainRegistryTests.swift +++ b/Tests/SKCoreTests/ToolchainRegistryTests.swift @@ -12,7 +12,7 @@ @testable import SKCore import Basic -import Utility +import SPMUtility import XCTest import POSIX @@ -186,7 +186,7 @@ final class ToolchainRegistryTests: XCTestCase { XCTAssertNil(tr.default) XCTAssert(tr.toolchains.isEmpty) - try! setenv("SOURCEKIT_PATH", value: "/bogus:\(binPath.asString):/bogus2") + try! setenv("SOURCEKIT_PATH", value: "/bogus:\(binPath):/bogus2") defer { try! setenv("SOURCEKIT_PATH", value: "") } tr.scanForToolchains(fs) @@ -197,7 +197,7 @@ final class ToolchainRegistryTests: XCTestCase { } XCTAssertEqual(tr.default?.identifier, tc.identifier) - XCTAssertEqual(tc.identifier, binPath.asString) + XCTAssertEqual(tc.identifier, binPath.description) XCTAssertNil(tc.clang) XCTAssertNil(tc.clangd) XCTAssertNil(tc.swiftc) @@ -205,7 +205,7 @@ final class ToolchainRegistryTests: XCTestCase { XCTAssertNil(tc.libIndexStore) let binPath2 = AbsolutePath("/other/my_toolchain/bin") - try! setenv("SOME_TEST_ENV_PATH", value: "/bogus:\(binPath2.asString):/bogus2") + try! setenv("SOME_TEST_ENV_PATH", value: "/bogus:\(binPath2):/bogus2") makeToolchain(binPath: binPath2, fs, sourcekitd: true) tr.scanForToolchains(pathVariables: ["NOPE", "SOME_TEST_ENV_PATH", "MORE_NOPE"], fs) @@ -215,7 +215,7 @@ final class ToolchainRegistryTests: XCTestCase { } XCTAssertEqual(tr.default?.identifier, tc.identifier) - XCTAssertEqual(tc2.identifier, binPath2.asString) + XCTAssertEqual(tc2.identifier, binPath2.description) XCTAssertNotNil(tc2.sourcekitd) } @@ -228,7 +228,7 @@ final class ToolchainRegistryTests: XCTestCase { XCTAssertNil(tr.default) XCTAssert(tr.toolchains.isEmpty) - try! setenv("TEST_SOURCEKIT_TOOLCHAIN_PATH_1", value: binPath.parentDirectory.asString) + try! setenv("TEST_SOURCEKIT_TOOLCHAIN_PATH_1", value: binPath.parentDirectory.description) tr.scanForToolchains(environmentVariables: ["TEST_SOURCEKIT_TOOLCHAIN_PATH_1"], fs) @@ -238,7 +238,7 @@ final class ToolchainRegistryTests: XCTestCase { } XCTAssertEqual(tr.default?.identifier, tc.identifier) - XCTAssertEqual(tc.identifier, binPath.parentDirectory.asString) + XCTAssertEqual(tc.identifier, binPath.parentDirectory.description) XCTAssertNil(tc.clang) XCTAssertNil(tc.clangd) XCTAssertNil(tc.swiftc) @@ -255,7 +255,7 @@ final class ToolchainRegistryTests: XCTestCase { XCTAssertNil(tr.default) XCTAssert(tr.toolchains.isEmpty) - try! setenv("TEST_ENV_SOURCEKIT_TOOLCHAIN_PATH_2", value: binPath.parentDirectory.asString) + try! setenv("TEST_ENV_SOURCEKIT_TOOLCHAIN_PATH_2", value: binPath.parentDirectory.description) tr.scanForToolchains( environmentVariables: ["TEST_ENV_SOURCEKIT_TOOLCHAIN_PATH_2"], @@ -267,7 +267,7 @@ final class ToolchainRegistryTests: XCTestCase { return } - XCTAssertEqual(tc.identifier, binPath.parentDirectory.asString) + XCTAssertEqual(tc.identifier, binPath.parentDirectory.description) XCTAssertNil(tc.clang) XCTAssertNil(tc.clangd) XCTAssertNil(tc.swiftc) @@ -298,7 +298,7 @@ final class ToolchainRegistryTests: XCTestCase { XCTAssertNil(t1.swiftc) func chmodRX(_ path: AbsolutePath) { - XCTAssertEqual(chmod(path.asString, S_IRUSR | S_IXUSR), 0) + XCTAssertEqual(chmod(path.description, S_IRUSR | S_IXUSR), 0) } chmodRX(path.appending(components: "bin", "clang")) @@ -471,7 +471,7 @@ private func makeToolchain( let makeExec = { (path: AbsolutePath) in try! fs.writeFileContents(path , bytes: "") if shouldChmod { - XCTAssertEqual(chmod(path.asString, S_IRUSR | S_IXUSR), 0) + XCTAssertEqual(chmod(path.description, S_IRUSR | S_IXUSR), 0) } } diff --git a/Tests/SKSwiftPMWorkspaceTests/SwiftPMWorkspaceTests.swift b/Tests/SKSwiftPMWorkspaceTests/SwiftPMWorkspaceTests.swift index 8afd8ac6..95543a41 100644 --- a/Tests/SKSwiftPMWorkspaceTests/SwiftPMWorkspaceTests.swift +++ b/Tests/SKSwiftPMWorkspaceTests/SwiftPMWorkspaceTests.swift @@ -14,7 +14,7 @@ import SKSwiftPMWorkspace import SKCore import PackageModel import Basic -import Utility +import SPMUtility import SKTestSupport import XCTest @@ -118,9 +118,9 @@ final class SwiftPMWorkspaceTests: XCTestCase { check("-target", "x86_64-unknown-linux", arguments: arguments) #endif - check("-I", build.asString, arguments: arguments) + check("-I", build.description, arguments: arguments) - check(aswift.asString, arguments: arguments) + check(aswift.description, arguments: arguments) } func testBuildSetup() { @@ -186,7 +186,7 @@ final class SwiftPMWorkspaceTests: XCTestCase { let arguments = ws.settings(for: source.asURL, .swift)!.compilerArguments check("-swift-version", "4.2", arguments: arguments) - check(source.asString, arguments: arguments) + check(source.description, arguments: arguments) } func testMultiFileSwift() { @@ -215,11 +215,11 @@ final class SwiftPMWorkspaceTests: XCTestCase { let bswift = packageRoot.appending(components: "Sources", "lib", "b.swift") let argumentsA = ws.settings(for: aswift.asURL, .swift)!.compilerArguments - check(aswift.asString, arguments: argumentsA) - check(bswift.asString, arguments: argumentsA) + check(aswift.description, arguments: argumentsA) + check(bswift.description, arguments: argumentsA) let argumentsB = ws.settings(for: aswift.asURL, .swift)!.compilerArguments - check(aswift.asString, arguments: argumentsB) - check(bswift.asString, arguments: argumentsB) + check(aswift.description, arguments: argumentsB) + check(bswift.description, arguments: argumentsB) } func testMultiTargetSwift() { @@ -253,14 +253,17 @@ final class SwiftPMWorkspaceTests: XCTestCase { let aswift = packageRoot.appending(components: "Sources", "libA", "a.swift") let bswift = packageRoot.appending(components: "Sources", "libB", "b.swift") let arguments = ws.settings(for: aswift.asURL, .swift)!.compilerArguments - check(aswift.asString, arguments: arguments) - checkNot(bswift.asString, arguments: arguments) - check("-I", packageRoot.appending(components: "Sources", "libC", "include").asString, arguments: arguments) + check(aswift.description, arguments: arguments) + checkNot(bswift.description, arguments: arguments) + check( + "-I", packageRoot.appending(components: "Sources", "libC", "include").description, + arguments: arguments) let argumentsB = ws.settings(for: bswift.asURL, .swift)!.compilerArguments - check(bswift.asString, arguments: argumentsB) - checkNot(aswift.asString, arguments: argumentsB) - checkNot("-I", packageRoot.appending(components: "Sources", "libC", "include").asString, arguments: argumentsB) + check(bswift.description, arguments: argumentsB) + checkNot(aswift.description, arguments: argumentsB) + checkNot("-I", packageRoot.appending(components: "Sources", "libC", "include").description, + arguments: argumentsB) } func testUnknownFile() { @@ -338,23 +341,24 @@ final class SwiftPMWorkspaceTests: XCTestCase { check("-target", "x86_64-unknown-linux", arguments: arguments) #endif - check("-I", packageRoot.appending(components: "Sources", "lib", "include").asString, arguments: arguments) - checkNot("-I", build.asString, arguments: arguments) - checkNot(bcxx.asString, arguments: arguments) + check("-I", packageRoot.appending(components: "Sources", "lib", "include").description, + arguments: arguments) + checkNot("-I", build.description, arguments: arguments) + checkNot(bcxx.description, arguments: arguments) } let args = ws.settings(for: acxx.asURL, .cpp)!.compilerArguments checkArgsCommon(args) check("-MD", "-MT", "dependencies", - "-MF", build.appending(components: "lib.build", "a.cpp.d").asString, + "-MF", build.appending(components: "lib.build", "a.cpp.d").description, arguments: args) - check("-c", acxx.asString, arguments: args) - check("-o", build.appending(components: "lib.build", "a.cpp.o").asString, arguments: args) + check("-c", acxx.description, arguments: args) + check("-o", build.appending(components: "lib.build", "a.cpp.o").description, arguments: args) let header = packageRoot.appending(components: "Sources", "lib", "include", "a.h") let headerArgs = ws.settings(for: header.asURL, .cpp)!.compilerArguments checkArgsCommon(headerArgs) - check("-c", "-x", "c++-header", header.asString, arguments: headerArgs) + check("-c", "-x", "c++-header", header.description, arguments: headerArgs) } func testDeploymentTargetSwift() {