From 38b407b1485b23056f6aefce12bf1adb92624a36 Mon Sep 17 00:00:00 2001 From: Lukas Jost Date: Sat, 17 Oct 2026 22:11:25 +0200 Subject: [PATCH] feat(catalog): publish versioned permission manifest --- common/build.gradle.kts | 8 ++++++++ .../resources/META-INF/grounds/permissions.index | 1 + .../permissions/plugin-grounds-runtime.json | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 common/src/main/resources/META-INF/grounds/permissions.index create mode 100644 common/src/main/resources/META-INF/grounds/permissions/plugin-grounds-runtime.json diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 20cda01..ae70141 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -68,3 +68,11 @@ configure { } tasks.named("processResources") { from(runtimeCatalogFile) { into("") } } + +// Keep the publishing artifact version with its catalog when bundled into a host JAR. +tasks.named("processResources") { + inputs.property("permissionManifestVersion", project.version.toString()) + filesMatching("META-INF/grounds/permissions/*.json") { + expand("version" to project.version.toString()) + } +} diff --git a/common/src/main/resources/META-INF/grounds/permissions.index b/common/src/main/resources/META-INF/grounds/permissions.index new file mode 100644 index 0000000..c82d8c8 --- /dev/null +++ b/common/src/main/resources/META-INF/grounds/permissions.index @@ -0,0 +1 @@ +META-INF/grounds/permissions/plugin-grounds-runtime.json diff --git a/common/src/main/resources/META-INF/grounds/permissions/plugin-grounds-runtime.json b/common/src/main/resources/META-INF/grounds/permissions/plugin-grounds-runtime.json new file mode 100644 index 0000000..07ff034 --- /dev/null +++ b/common/src/main/resources/META-INF/grounds/permissions/plugin-grounds-runtime.json @@ -0,0 +1,16 @@ +{ + "source": "plugin-grounds-runtime", + "permissions": [ + { + "key": "grounds.runtime.info", + "label": "Inspect runtime information", + "description": "View runtime and installed library information.", + "supportedScopes": [ + "GLOBAL", + "SERVER_TYPE", + "SERVER" + ] + } + ], + "sourceVersion": "${version}" +}