@@ -121,7 +121,7 @@ public struct AddPackageTarget: ManifestEditRefactoringProvider {
121121 )
122122 }
123123
124- let outerPath = RelativePath ( outerDirectory)
124+ let outerPath = outerDirectory
125125
126126 /// The set of auxiliary files this refactoring will create.
127127 var auxiliaryFiles : AuxiliaryFiles = [ ]
@@ -186,14 +186,12 @@ public struct AddPackageTarget: ManifestEditRefactoringProvider {
186186 /// Add the primary source file for a target to the list of auxiliary
187187 /// source files.
188188 fileprivate static func addPrimarySourceFile(
189- outerPath: RelativePath ,
189+ outerPath: String ,
190190 target: PackageTarget ,
191191 configuration: Configuration ,
192192 to auxiliaryFiles: inout AuxiliaryFiles
193193 ) {
194- let sourceFilePath = outerPath. appending (
195- components: [ target. name, " \( target. name) .swift " ]
196- )
194+ let sourceFilePath = " \( outerPath) / \( target. name) / \( target. name) .swift "
197195
198196 // Introduce imports for each of the dependencies that were specified.
199197 var importModuleNames = target. dependencies. map {
@@ -299,14 +297,12 @@ public struct AddPackageTarget: ManifestEditRefactoringProvider {
299297 /// Add a file that introduces the main entrypoint and provided macros
300298 /// for a macro target.
301299 fileprivate static func addProvidedMacrosSourceFile(
302- outerPath: RelativePath ,
300+ outerPath: String ,
303301 target: PackageTarget ,
304302 to auxiliaryFiles: inout AuxiliaryFiles
305303 ) {
306304 auxiliaryFiles. addSourceFile (
307- path: outerPath. appending (
308- components: [ target. name, " ProvidedMacros.swift " ]
309- ) ,
305+ path: " \( outerPath) / \( target. name) /ProvidedMacros.swift " ,
310306 sourceCode: """
311307 import SwiftCompilerPlugin
312308
@@ -335,12 +331,12 @@ fileprivate extension PackageTarget.Dependency {
335331
336332/// The array of auxiliary files that can be added by a package editing
337333/// operation.
338- fileprivate typealias AuxiliaryFiles = [ ( RelativePath , SourceFileSyntax ) ]
334+ fileprivate typealias AuxiliaryFiles = [ ( String , SourceFileSyntax ) ]
339335
340336fileprivate extension AuxiliaryFiles {
341337 /// Add a source file to the list of auxiliary files.
342338 mutating func addSourceFile(
343- path: RelativePath ,
339+ path: String ,
344340 sourceCode: SourceFileSyntax
345341 ) {
346342 self . append ( ( path, sourceCode) )
@@ -357,8 +353,8 @@ fileprivate let macroTargetDependencies: [PackageTarget.Dependency] = [
357353/// The package dependency for swift-syntax, for use in macros.
358354fileprivate extension PackageDependency {
359355 /// Source control URL for the swift-syntax package.
360- static var swiftSyntaxURL : SourceControlURL {
361- . init ( " https://github.com/swiftlang/swift-syntax.git " )
356+ static var swiftSyntaxURL : String {
357+ " https://github.com/swiftlang/swift-syntax.git "
362358 }
363359
364360 /// Package dependency on the swift-syntax package.
@@ -367,7 +363,7 @@ fileprivate extension PackageDependency {
367363 ) -> PackageDependency {
368364 return . sourceControl(
369365 . init(
370- identity: PackageIdentity ( " swift-syntax " ) ,
366+ identity: " swift-syntax " ,
371367 location: . remote( swiftSyntaxURL) ,
372368 requirement: . rangeFrom( version)
373369 )
0 commit comments