From 8f776db8cf20a51f3d3952a671c9986abf51bea8 Mon Sep 17 00:00:00 2001 From: HappyAreaBean Date: Mon, 15 Apr 2024 15:32:38 +0800 Subject: [PATCH] build: update plugin.yml version logic use fullVersion if the project version is endsWith "-SNAPSHOT" --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index 449e477..56b5a39 100644 --- a/build.gradle +++ b/build.gradle @@ -5,11 +5,15 @@ plugins { id 'kr.entree.spigradle' version '2.4.2' id 'java' id "xyz.jpenilla.run-paper" version "2.1.0" + id 'net.kyori.indra.git' version "3.1.3" } group 'cc.happyareabean' version '1.1.5-SNAPSHOT' +def gitCommit = indraGit.commit().abbreviate(7).name() +def fullVersion = "${project.version}-${gitCommit}" + sourceCompatibility = JavaLanguageVersion.of(8) targetCompatibility = JavaLanguageVersion.of(8) @@ -88,6 +92,7 @@ dependencies { spigot { // The 'name' and 'version' will be set to project.version and project.name, // But we may set those manually. + version = project.version.toString().endsWith("-SNAPSHOT") ? fullVersion : project.version apiVersion '1.13' excludeLibraries = ['*'] softDepends 'PlaceholderAPI'