Skip to content

Commit 0b368e7

Browse files
authored
Merge pull request swiftlang#80 from benlangmuir/update-swiftpm
[swiftpm] Update to latest master
2 parents 1ee8762 + 7f697fa commit 0b368e7

19 files changed

+89
-82
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/SKCore/BuildSetup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Basic
14-
import Utility
14+
import SPMUtility
1515
import SKSupport
1616

1717
/// Build configuration

Sources/SKCore/CompilationDatabaseBuildSystem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
6969
}
7070

7171
if compdb == nil {
72-
log("could not open compilation database for \(path.asString)", level: .warning)
72+
log("could not open compilation database for \(path)", level: .warning)
7373
}
7474

7575
return compdb

Sources/SKCore/FallbackBuildSystem.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import LanguageServerProtocol
1414
import Basic
15-
import enum Utility.Platform
15+
import enum SPMUtility.Platform
1616

1717
/// A simple BuildSystem suitable as a fallback when accurate settings are unknown.
1818
public final class FallbackBuildSystem: BuildSystem {
@@ -53,10 +53,10 @@ public final class FallbackBuildSystem: BuildSystem {
5353
if let sdkpath = sdkpath {
5454
args += [
5555
"-sdk",
56-
sdkpath.asString,
56+
sdkpath.description,
5757
]
5858
}
59-
args.append(path.asString)
59+
args.append(path.description)
6060
return FileBuildSettings(preferredToolchain: nil, compilerArguments: args)
6161
}
6262

@@ -65,10 +65,10 @@ public final class FallbackBuildSystem: BuildSystem {
6565
if let sdkpath = sdkpath {
6666
args += [
6767
"-isysroot",
68-
sdkpath.asString,
68+
sdkpath.description,
6969
]
7070
}
71-
args.append(path.asString)
71+
args.append(path.description)
7272
return FileBuildSettings(preferredToolchain: nil, compilerArguments: args)
7373
}
7474
}

Sources/SKCore/Toolchain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SKSupport
1414
import Basic
15-
import Utility
15+
import SPMUtility
1616

1717
/// A Toolchain is a collection of related compilers and libraries meant to be used together to
1818
/// build and edit source code.
@@ -107,7 +107,7 @@ extension Toolchain {
107107
path: path)
108108
} else {
109109
self.init(
110-
identifier: path.asString,
110+
identifier: path.description,
111111
displayName: path.basename,
112112
path: path)
113113
}

Sources/SKCore/ToolchainRegistry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SKSupport
1414
import Basic
15-
import Utility
15+
import SPMUtility
1616
import Dispatch
1717
import POSIX
1818
import Foundation

Sources/SKSupport/BuildConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Utility
13+
import SPMUtility
1414

1515
public enum BuildConfiguration: String {
1616
case debug

Sources/SKSupport/LogLevel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Utility
13+
import SPMUtility
1414

1515
#if canImport(os)
1616
import os

Sources/SKSupport/Platform.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Utility
13+
import SPMUtility
1414

1515
extension Platform {
1616

Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import LanguageServerProtocol
1414
import SKCore
1515
import Basic
16-
import Utility
16+
import SPMUtility
1717
import SKSupport
1818
import Build
1919
import PackageModel
@@ -95,14 +95,14 @@ public final class SwiftPMWorkspace {
9595
var extraSwiftFlags: [String] = []
9696
var extraClangFlags: [String] = []
9797
if let sdk = sdk {
98-
extraSwiftFlags += ["-sdk", sdk.asString]
99-
extraClangFlags += ["-isysroot", sdk.asString]
98+
extraSwiftFlags += ["-sdk", sdk.description]
99+
extraClangFlags += ["-isysroot", sdk.description]
100100
}
101101

102102
if let platformPath = platformPath {
103103
let flags = [
104104
"-F",
105-
platformPath.appending(components: "Developer", "Library", "Frameworks").asString
105+
platformPath.appending(components: "Developer", "Library", "Frameworks").description
106106
]
107107
extraSwiftFlags += flags
108108
extraClangFlags += flags
@@ -159,7 +159,7 @@ public final class SwiftPMWorkspace {
159159
fileSystem: localFileSystem,
160160
buildSetup: buildSetup)
161161
} catch Error.noManifest(let path) {
162-
log("could not find manifest, or not a SwiftPM package: \(path.asString)", level: .warning)
162+
log("could not find manifest, or not a SwiftPM package: \(path)", level: .warning)
163163
return nil
164164
} catch {
165165
log("failed to create \(SwiftPMWorkspace.self): \(error)", level: .error)
@@ -277,7 +277,7 @@ extension SwiftPMWorkspace {
277277
/// Retrieve settings for a package manifest (Package.swift).
278278
func settings(forPackageManifest path: AbsolutePath) -> FileBuildSettings? {
279279
for package in packageGraph.packages where path == package.manifest.path {
280-
let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.asString]
280+
let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.description]
281281
return FileBuildSettings(
282282
preferredToolchain: nil,
283283
compilerArguments: compilerArgs
@@ -311,21 +311,21 @@ extension SwiftPMWorkspace {
311311
"-emit-dependencies",
312312
"-emit-module",
313313
"-emit-module-path",
314-
buildPath.appending(component: "\(td.target.c99name).swiftmodule").asString,
314+
buildPath.appending(component: "\(td.target.c99name).swiftmodule").description
315315
// -output-file-map <path>
316316
]
317317
if td.target.type == .library || td.target.type == .test {
318318
args += ["-parse-as-library"]
319319
}
320320
args += ["-c"]
321-
args += td.target.sources.paths.map { $0.asString }
322-
args += ["-I", buildPath.asString]
321+
args += td.target.sources.paths.map { $0.description }
322+
args += ["-I", buildPath.description]
323323
args += td.compileArguments()
324324

325325
return FileBuildSettings(
326326
preferredToolchain: nil,
327327
compilerArguments: args,
328-
workingDirectory: workspacePath.asString)
328+
workingDirectory: workspacePath.description)
329329
}
330330

331331
/// Retrieve settings for the given C-family language file, which is part of a known target build
@@ -348,7 +348,7 @@ extension SwiftPMWorkspace {
348348
"-MT",
349349
"dependencies",
350350
"-MF",
351-
compilePath.deps.asString,
351+
compilePath.deps.description,
352352
]
353353
}
354354

@@ -368,27 +368,27 @@ extension SwiftPMWorkspace {
368368
if let compilePath = compilePath {
369369
args += [
370370
"-c",
371-
compilePath.source.asString,
371+
compilePath.source.description,
372372
"-o",
373-
compilePath.object.asString
373+
compilePath.object.description
374374
]
375375
} else if path.extension == "h" {
376376
args += ["-c"]
377377
if let xflag = language.xflagHeader {
378378
args += ["-x", xflag]
379379
}
380-
args += [path.asString]
380+
args += [path.description]
381381
} else {
382382
args += [
383383
"-c",
384-
path.asString,
384+
path.description,
385385
]
386386
}
387387

388388
return FileBuildSettings(
389389
preferredToolchain: nil,
390390
compilerArguments: args,
391-
workingDirectory: workspacePath.asString)
391+
workingDirectory: workspacePath.description)
392392
}
393393
}
394394

Sources/SKTestSupport/TestServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SKSupport
1414
import SKCore
15-
import Utility
15+
import SPMUtility
1616
import LanguageServerProtocol
1717
import LanguageServerProtocolJSONRPC
1818
import SourceKit

Sources/SourceKit/SourceKitServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SKCore
1515
import SKSupport
1616
import IndexStoreDB
1717
import Basic
18-
import Utility
18+
import SPMUtility
1919
import Dispatch
2020
import Foundation
2121
import SPMLibc
@@ -172,7 +172,7 @@ public final class SourceKitServer: LanguageServer {
172172
let resp = try service.sendSync(InitializeRequest(
173173
processId: Int(getpid()),
174174
rootPath: nil,
175-
rootURL: (workspace?.rootPath).map { URL(fileURLWithPath: $0.asString) },
175+
rootURL: (workspace?.rootPath).map { URL(fileURLWithPath: $0.description) },
176176
initializationOptions: InitializationOptions(),
177177
capabilities: workspace?.clientCapabilities ?? ClientCapabilities(workspace: nil, textDocument: nil),
178178
trace: .off,

Sources/SourceKit/Workspace.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SKCore
1515
import SKSupport
1616
import IndexStoreDB
1717
import Basic
18-
import Utility
18+
import SPMUtility
1919
import SKSwiftPMWorkspace
2020

2121
/// Represents the configuration and sate of a project or combination of projects being worked on
@@ -95,9 +95,12 @@ public final class Workspace {
9595
let libPath = toolchainRegistry.default?.libIndexStore
9696
{
9797
do {
98-
let lib = try IndexStoreLibrary(dylibPath: libPath.asString)
99-
self.index = try IndexStoreDB(storePath: storePath.asString, databasePath: dbPath.asString, library: lib)
100-
log("opened IndexStoreDB at \(dbPath.asString) with store path \(storePath.asString)")
98+
let lib = try IndexStoreLibrary(dylibPath: libPath.description)
99+
self.index = try IndexStoreDB(
100+
storePath: storePath.description,
101+
databasePath: dbPath.description,
102+
library: lib)
103+
log("opened IndexStoreDB at \(dbPath) with store path \(storePath)")
101104
} catch {
102105
log("failed to open IndexStoreDB: \(error.localizedDescription)", level: .error)
103106
}

Sources/SourceKit/clangd/ClangLanguageServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func makeJSONRPCClangServer(client: MessageHandler, clangd: AbsolutePath, buildS
149149
if #available(OSX 10.13, *) {
150150
process.executableURL = clangd.asURL
151151
} else {
152-
process.launchPath = clangd.asString
152+
process.launchPath = clangd.description
153153
}
154154

155155
process.arguments = [

Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class SwiftSourceKitFramework {
4242

4343
init(dylib path: AbsolutePath) throws {
4444
self.path = path
45-
self.dylib = try dlopen(path.asString, mode: [.lazy, .local, .first, .deepBind])
45+
self.dylib = try dlopen(path.description, mode: [.lazy, .local, .first, .deepBind])
4646

4747
func dlsym_required<T>(_ handle: DLHandle, symbol: String) throws -> T {
4848
guard let sym: T = dlsym(handle, symbol: symbol) else {

Sources/sourcekit-lsp/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import SKCore
1818
import SPMLibc
1919
import Dispatch
2020
import Basic
21-
import Utility
21+
import SPMUtility
2222
import Foundation
2323
import sourcekitd // Not needed here, but fixes debugging...
2424

Tests/SKCoreTests/FallbackBuildSystemTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ final class FallbackBuildSystemTests: XCTestCase {
3434
let args = settings.compilerArguments
3535
XCTAssertEqual(args, [
3636
"-sdk",
37-
sdk.asString,
38-
source.asString,
37+
sdk.description,
38+
source.description,
3939
])
4040

4141
bs.sdkpath = nil
4242

4343
XCTAssertEqual(bs.settings(for: source.asURL, .swift)?.compilerArguments, [
44-
source.asString,
44+
source.description,
4545
])
4646
}
4747

@@ -59,14 +59,14 @@ final class FallbackBuildSystemTests: XCTestCase {
5959
let args = settings.compilerArguments
6060
XCTAssertEqual(args, [
6161
"-isysroot",
62-
sdk.asString,
63-
source.asString,
62+
sdk.description,
63+
source.description,
6464
])
6565

6666
bs.sdkpath = nil
6767

6868
XCTAssertEqual(bs.settings(for: source.asURL, .cpp)?.compilerArguments, [
69-
source.asString,
69+
source.description,
7070
])
7171
}
7272

@@ -75,7 +75,7 @@ final class FallbackBuildSystemTests: XCTestCase {
7575
let bs = FallbackBuildSystem()
7676
bs.sdkpath = nil
7777
XCTAssertEqual(bs.settings(for: source.asURL, .c)?.compilerArguments, [
78-
source.asString,
78+
source.description,
7979
])
8080
}
8181

@@ -84,7 +84,7 @@ final class FallbackBuildSystemTests: XCTestCase {
8484
let bs = FallbackBuildSystem()
8585
bs.sdkpath = nil
8686
XCTAssertEqual(bs.settings(for: source.asURL, .objective_c)?.compilerArguments, [
87-
source.asString,
87+
source.description,
8888
])
8989
}
9090

@@ -93,7 +93,7 @@ final class FallbackBuildSystemTests: XCTestCase {
9393
let bs = FallbackBuildSystem()
9494
bs.sdkpath = nil
9595
XCTAssertEqual(bs.settings(for: source.asURL, .objective_cpp)?.compilerArguments, [
96-
source.asString,
96+
source.description,
9797
])
9898
}
9999

0 commit comments

Comments
 (0)