Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Examples/counter/Icons/actionDefaultImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/actionDefaultImage@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/actionIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/actionIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/category-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/category-icon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/pluginIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/pluginIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/stopwatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/counter/Icons/stopwatch@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Examples/counter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to Build and Validate

## Build the Binary from Source Code

From the counter example directory run:

`swift build`

## Export the Plugin

Export manifest and copy the binary to the plugin folder and define the uuid of the plug-in:

`swift run counter-plugin export com.example.counter --output . --generate-manifest --copy-executable --executable-name "counter-plugin"`

## Copy Resources (Icons)

`cp -r Icons com.example.counter.sdPlugin`

## Validate plug-in

Run the streamdeck CLI validate tool requires tool to be installed:

`streamdeck validate com.example.counter.sdPlugin`
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DecrementAction: KeyAction {

static var name: String = "Decrement"

static var uuid: String = "counter.decrement"
static var uuid: String = "com.example.counter.decrement"

static var icon: String = "Icons/actionIcon"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IncrementAction: KeyAction {

static var name: String = "Increment"

static var uuid: String = "counter.increment"
static var uuid: String = "com.example.counter.increment"

static var icon: String = "Icons/actionIcon"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RotaryAction: EncoderAction {

static var name: String = "Count"

static var uuid: String = "counter.rotary"
static var uuid: String = "com.example.counter.rotary"

static var icon: String = "Icons/actionIcon"

Expand Down
7 changes: 6 additions & 1 deletion Examples/counter/Sources/counter/CounterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ fileprivate let log = Logger(subsystem: "Counter Plugin", category: "Main Plugin
class CounterPlugin: Plugin {

// MARK: Manifest
static var uuid: String = "com.example.counter"
static var name: String = "Counter"
static var category: String? = "Counter"
static var categoryIcon: String? = "Icons/category-icon"

static var description: String = "Count things. On your Stream Deck!"

Expand All @@ -25,9 +28,11 @@ class CounterPlugin: Plugin {

static var url: URL? = URL(string: "https://github.com/emorydunn/StreamDeckPlugin")

static var version: String = "0.5"
static var version: String = "0.5.0.0"

static var os: [PluginOS] = [.macOS(.v11)]

static var software: PluginSoftware = .minimumVersion("6.4")

@ActionBuilder
static var actions: [any Action.Type] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public protocol Plugin {

// MARK: Manifest

/// The uuid of the plugin.
///
/// This string must be unique among all the plugins.
static var uuid: String { get }

/// The name of the plugin.
///
/// This string is displayed to the user in the Stream Deck store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import Foundation
/// See the [SDK documentation](https://docs.elgato.com/streamdeck/sdk/references/manifest) for more information.
struct PluginManifest: Codable {

/// Unique identifier of the plugin, represented in reverse-DNS format
///
/// This is a required field and must be unique for all plug-ins
var uuid: String?


/// The name of the plugin.
///
/// This string is displayed to the user in the Stream Deck store.
Expand Down Expand Up @@ -198,6 +204,7 @@ struct PluginManifest: Codable {
}

init(plugin: any Plugin.Type) {
self.uuid = plugin.uuid
self.name = plugin.name
self.description = plugin.description
self.category = plugin.category
Expand Down
Loading