Commit 82283da7 authored by Johannes Schriewer's avatar Johannes Schriewer

Update atfoundation, use operator overloads for path joining

parent 9a6d4437
Pipeline #1653 failed with stage
Subproject commit febfd9866c3786bd5bc0c68d8dbbc22969f479ab
Subproject commit 879753c21c6405c7b49623710703c64799706a67
......@@ -21,7 +21,7 @@ import atfoundation
public func collectSources(sourceDescriptions: [String], taskForCalculatingPath task: Task?) -> [Path] {
var sources : [Path] = []
for unPrefixedDescription in sourceDescriptions {
let description = (task?.importedPath ?? Path(string: "")).appending(unPrefixedDescription)
let description = (task?.importedPath ?? Path("")).appending(unPrefixedDescription)
if unPrefixedDescription.hasSuffix("**.swift") {
let basepath = description.dirname()
do {
......
......@@ -129,7 +129,7 @@ final public class Package {
return arr
}
var adjustedImportPath: Path = Path(string: "")
var adjustedImportPath: Path = Path("")
/**Calculate the pruned dependency graph for the given task
- returns: A list of tasks in a reasonable order to be processed. */
......@@ -208,9 +208,8 @@ final public class Package {
}
for importFile in imports {
guard let importFileString = importFile.string else { fatalError("Non-string import \(importFile)")}
let importedFile = Path(string: importFileString)
let adjustedImportPath = pathOnDisk.join(path: importedFile).dirname()
let remotePackage = try Package(filepath: pathOnDisk.join(path: importedFile), overlay: requestedGlobalOverlays, focusOnTask: nil)
let adjustedImportPath = (pathOnDisk + importFileString).dirname()
let remotePackage = try Package(filepath: pathOnDisk + importFileString, overlay: requestedGlobalOverlays, focusOnTask: nil)
remotePackage.adjustedImportPath = adjustedImportPath
remotePackages.append(remotePackage)
}
......@@ -245,10 +244,9 @@ final public class Package {
let importFileString = "external/" + externalDep.name + "/build.atpkg"
// import the atbuild file if it is there
let importedFile = Path(string: importFileString)
let adjustedImportPath = pathOnDisk.join(path: importedFile).dirname()
let adjustedImportPath = (pathOnDisk + importFileString).dirname()
do {
let remotePackage = try Package(filepath: pathOnDisk.join(path: importedFile), overlay: requestedGlobalOverlays, focusOnTask: nil)
let remotePackage = try Package(filepath: pathOnDisk + importFileString, overlay: requestedGlobalOverlays, focusOnTask: nil)
remotePackage.adjustedImportPath = adjustedImportPath
remotePackages.append(remotePackage)
} catch PackageError.ParserFailed {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment