Skip to content

STRUCT

PluginLocation

Contents

  • Properties
    • type
  • Methods
    • local(path:manifest:)
    • git(url:tag:directory:)
    • git(url:sha:directory:)
    • remote(url:manifest:)
    • remote(urls:manifest:)
    • remote(baseUrl:name:version:os:)
swift
public struct PluginLocation: Codable, Equatable

A location to a plugin, either local or remote.

Properties

type

swift
public var type: LocationType

The type of location local or git.

Methods

local(path:manifest:)

swift
public static func local(path: FilePath, manifest: PluginConfigManifest? = nil) -> Self

A Path to a directory containing a Plugin manifest.

Example:

swift
.local(path: "/User/local/bin")

git(url:tag:directory:)

swift
public static func git(url: String, tag: String, directory: String? = nil) -> Self

A URL to a git repository pointing at a tag. You can also specify a custom directory in case the plugin is not located at the root of the repository. You can also specify a custom release URL from where the plugin binary should be downloaded. If not specified, it defaults to the GitHub release URL. Note that the URL should be publicly reachable.

Example:

swift
.git(url: "https://git/plugin.git", tag: "1.0.0", directory: "PluginDirectory")

git(url:sha:directory:)

swift
public static func git(url: String, sha: String, directory: String? = nil) -> Self

A URL to a git repository pointing at a commit sha. You can also specify a custom directory in case the plugin is not located at the root of the repository.

Example:

swift
.git(url: "https://git/plugin.git", sha: "d06b4b3d")

remote(url:manifest:)

swift
public static func remote(url: String, manifest: PluginConfigManifest) -> PluginLocation

Use remote archive with the plugin.

Example:

swift
.remote(url: "https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.macos.geko-plugin.zip"),

.remote(
    url: "https://s3.example.com/bucket/SomeArchive/2.5.0/SomeArchive.xcframework.zip",
    manifest: .plugin(
       name: "some_util",
       executables: [
           .init(name: "some_util", path: "some_util/bin"),
       ]
   )
),

remote(urls:manifest:)

swift
public static func remote(urls: [PluginOS: String], manifest: PluginConfigManifest) -> PluginLocation

Use remote plugin archive with different operating systems support.

Example:

swift
.remote(urls: [
    .macos: "https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.macos.geko-plugin.zip"),
    .linux("aarch64"): "https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.linux.aarch64.geko-plugin.zip"),
 ]),

.remote(
    urls: [
        .macos: "https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.macos.geko-plugin.zip"),
        .linux("aarch64"): "https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.linux.aarch64.geko-plugin.zip"),
    ],
    manifest: .plugin(
       name: "some_util",
       executables: [
           .init(name: "some_util", path: "some_util/bin"),
       ]
   )
),

remote(baseUrl:name:version:os:)

swift
public static func remote(baseUrl: String, name: String, version: String, os: [PluginOS] = [.macos]) -> PluginLocation

Use remote archive with the plugin.

Example:

swift
// https://s3.example.com/bucket/GekoPlugin/1.0.2/GekoPlugin.macos.geko-plugin.zip
.remote(baseUrl: "https://s3.example.com/bucket", name: "GekoPlugin", version: "1.0.2"),