Back to Swift Package Manager

``PackagePlugin``

Sources/Runtimes/PackagePlugin/Documentation.docc/Documentation.md

0.6.01.8 KB
Original Source

PackagePlugin

Create plugins that extend the Swift Package Manager.

<!-- swift package --disable-sandbox preview-documentation --target PackagePlugin -->

Overview

Build tool plugins generate source files as part of a build, or perform other actions at the start of every build. The package manager invokes build tool plugins before a package is built in order to construct command invocations to run as part of the build. Command plugins provide actions that users can perform at any time and aren't associated with a build.

Read Writing a build tool plugin to learn how to create build tool plugins, or Writing a command plugin to learn how to create command plugins.

Topics

Implementing Command Plugins

  • CommandPlugin
  • PluginContext
  • Plugin

Extracting Arguments

  • ArgumentExtractor

Implementing Build Plugins

  • BuildToolPlugin
  • PluginContext
  • Target
  • Command

Interacting with Package Manager

  • PackageManager
  • PackageManagerProxyError

Inspecting the Package Representation

  • Package
  • ToolsVersion
  • PackageOrigin
  • PackageDependency
  • Product
  • ExecutableProduct
  • LibraryProduct

Inspecting Package Targets

  • Target
  • TargetDependency
  • SourceModuleTarget
  • ModuleKind
  • SwiftSourceModuleTarget
  • ClangSourceModuleTarget
  • BinaryArtifactTarget
  • SystemLibraryTarget

Inspecting Package Files

  • FileList

  • File

  • FileType

  • Path

  • PathList

Plugin Diagnostics and Errors

  • Diagnostics
  • PluginContextError
  • PluginDeserializationError