Contents

PackagePlugin

Create plugins that extend the Swift Package Manager.

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

Extracting Arguments

Implementing Build Plugins

Interacting with Package Manager

Inspecting the Package Representation

Inspecting Package Targets

Inspecting Package Files

Plugin Diagnostics and Errors

Extended Modules