Tool
Information about a particular tool that is available to a plugin.
struct Tool
Information about a particular tool that is available to a plugin.
struct Tool
import PackagePlugin
struct PluginContext
Provides information about the package for which the plugin is invoked, as well as contextual information based on the plugin’s stated intent and requirements.
let package: Package
Information about the package to which the plugin is being applied.
let pluginWorkDirectoryURL: URL
The path of a writable directory into which the plugin or the build commands it constructs can write anything it wants. This could include any generated source files that should be processed further, and it could include any caches used by the build tool or the plugin itself. The plugin is in complete control of what is written under this di- rectory, and the contents are preserved between builds.
func tool(named name: String) throws -> Tool
Looks up and returns the path of a named command line executable tool. The executable must be provided by an executable target or a binary target on which the package plugin target depends. This function throws an error if the tool cannot be found. The lookup is case sensitive.
let pluginWorkDirectory: Path
The path of a writable directory into which the plugin or the build commands it constructs can write anything it wants. This could include any generated source files that should be processed further, and it could include any caches used by the build tool or the plugin itself. The plugin is in complete control of what is written under this di- rectory, and the contents are preserved between builds.
let name: String
Name of the tool (suitable for display purposes).
let url: URL
Full path of the built or provided tool in the file system.
let path: Path
Full path of the built or provided tool in the file system.