-
-
Save laevandus/842ca1ed2feaf44c79dd5a5d1c66637c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import PackagePlugin | |
@main | |
struct ToomasKitPlugin: BuildToolPlugin { | |
func createBuildCommands(context: PackagePlugin.PluginContext, target: PackagePlugin.Target) async throws -> [PackagePlugin.Command] { | |
let inputJSON = target.directory.appending("Source.json") | |
let output = context.pluginWorkDirectory.appending("GeneratedEnum.swift") | |
return [ | |
.buildCommand(displayName: "Generate Code", | |
executable: try context.tool(named: "CodeGenerator").path, | |
arguments: [inputJSON, output], | |
environment: [:], | |
inputFiles: [inputJSON], | |
outputFiles: [output]) | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment