Skip to content

Creating a Plugin Manifest

Emory Dunn edited this page Aug 3, 2021 · 1 revision

In addition to creating the plugin executable you can also generate the manifest file needed for the plugin using a type safe struct. The idea is similar to how SwiftPM handles projects with Package.swift.

Creating A Manifest

In order to generate a manifest file you need to initialize a PluginManifest. You can do this is the main.swift file of your plugin.

let manifest = PluginManifest(
    name: "Counter",
    description: "Count things. On your Stream Deck!",
    author: "Emory Dunn",
    icon: "counter",
    version: "0.1",
    os: [
        .mac(minimumVersion: "10.15")
    ],
    software: .minimumVersion("4.1"),
    codePath: "counter-plugin")

When you register your plugin with the PluginManager you just need to pass your manifest into the main method:

PluginManager.main(plugin: CounterPlugin.self, manifest: manifest)

Generating the Manifest

To generate the manifest file you run the generate-manifest commend on your plugin's executable. For example:

counter-plugin generate-manifest --output /path/to/manifest.json

Clone this wiki locally