Skip to content

Commit 142f057

Browse files
committed
use url
1 parent aac355d commit 142f057

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Plugins/CodeGeneratorPlugin.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,29 @@ import PackagePlugin
44
@main
55
struct CodeGeneratorPlugin: BuildToolPlugin {
66
func createBuildCommands(context: PackagePlugin.PluginContext, target _: PackagePlugin.Target) async throws -> [PackagePlugin.Command] {
7-
let output = context.pluginWorkDirectory.appending("GeneratedCode")
7+
let output = context.pluginWorkDirectoryURL
8+
89
let floatingPointTypes: [String] = ["Float", "Double"]
910
let simdSizes = [2, 4, 8, 16, 32, 64]
1011

1112
let outputFiles = floatingPointTypes.flatMap { floatingPointType in
1213
simdSizes.flatMap { simdSize in
1314
[
14-
output.appending("SIMD\(simdSize)+\(floatingPointType)+RealFunctions.swift"),
15-
output.appending("SIMD\(simdSize)+\(floatingPointType)+RealFunctions+Derivatives.swift"),
15+
output.appending(component: "SIMD\(simdSize)+\(floatingPointType)+RealFunctions.swift"),
16+
output.appending(component: "SIMD\(simdSize)+\(floatingPointType)+RealFunctions+Derivatives.swift"),
1617
]
1718
} + [
18-
output.appending("\(floatingPointType)+RealFunctions+Derivatives.swift"),
19+
output.appending(component: "\(floatingPointType)+RealFunctions+Derivatives.swift"),
1920
]
2021
} + [
21-
output.appending("SIMD+RealFunctions.swift"),
22+
output.appending(component: "SIMD+RealFunctions.swift"),
2223
]
2324

2425
return [
2526
.buildCommand(
2627
displayName: "Generate Code",
27-
executable: try context.tool(named: "CodeGeneratorExecutable").path,
28-
arguments: [output.string],
28+
executable: try context.tool(named: "CodeGeneratorExecutable").url,
29+
arguments: [output.relativePath],
2930
environment: [:],
3031
inputFiles: [],
3132
outputFiles: outputFiles

0 commit comments

Comments
 (0)