From 28736d31658b448ac3f9eab66d959dde828c503d Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:48:24 -0800 Subject: [PATCH] Bump hangar-publish-plugin --- build.gradle.kts | 35 ++++++++++++++++++----------------- gradle/libs.versions.toml | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f6e84956..10c46234 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,3 @@ -import io.papermc.hangarpublishplugin.model.Platforms - plugins { id("carbon.build-logic") alias(libs.plugins.hangar.publish) @@ -9,41 +7,44 @@ plugins { val projectVersion: String by project // get from gradle.properties version = projectVersion +fun Project.platformJar(): Provider = + extensions.getByType().jarTask.flatMap { it.archiveFile } + hangarPublish.publications.register("plugin") { - version.set(projectVersion) - id.set("Carbon") - channel.set(if (projectVersion.contains("-beta.")) "Beta" else "Release") - changelog.set(releaseNotes) - apiKey.set(providers.environmentVariable("HANGAR_UPLOAD_KEY")) - platforms.register(Platforms.PAPER) { - jar.set(project(":carbonchat-paper").the().jarTask.flatMap { it.archiveFile }) + version = projectVersion + id = "Carbon" + channel = if (projectVersion.contains("-beta.")) "Beta" else "Release" + changelog = releaseNotes + apiKey = providers.environmentVariable("HANGAR_UPLOAD_KEY") + platforms.paper { + jar = project(":carbonchat-paper").platformJar() platformVersions.add("1.19.4-1.20.2") dependencies { url("LuckPerms", "https://luckperms.net/") hangar("Essentials") { - required.set(false) + required = false } url("DiscordSRV", "https://www.spigotmc.org/resources/discordsrv.18494/") { - required.set(false) + required = false } url("PlaceholderAPI", "https://www.spigotmc.org/resources/placeholderapi.6245/") { - required.set(false) + required = false } hangar("MiniPlaceholders") { - required.set(false) + required = false } } } - platforms.register(Platforms.VELOCITY) { - jar.set(project(":carbonchat-velocity").the().jarTask.flatMap { it.archiveFile }) + platforms.velocity { + jar = project(":carbonchat-velocity").platformJar() platformVersions.add("3.2") dependencies { url("LuckPerms", "https://luckperms.net/") hangar("MiniPlaceholders") { - required.set(false) + required = false } hangar("SignedVelocity") { - required.set(false) + required = false } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7677e353..65b8d3ec 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [plugins] sponge-gradle = { id = "org.spongepowered.gradle.plugin", version = "2.2.0" } -hangar-publish = { id = "io.papermc.hangar-publish-plugin", version = "0.1.0" } +hangar-publish = { id = "io.papermc.hangar-publish-plugin", version = "0.1.1" } indra-publishing-sonatype = { id = "net.kyori.indra.publishing.sonatype", version.ref = "indra" } [versions]