diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 17e2506..02f3e9b 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -4,6 +4,7 @@ plugins { `java-library` `maven-publish` alias(libs.plugins.blossom) + alias(libs.plugins.indragit) } @@ -17,21 +18,17 @@ dependencies { description = "RedisBungee interfaces" -blossom { - replaceToken("@version@", "$version") - // GIT - val commit: String; - val commitStdout = ByteArrayOutputStream() - rootProject.exec { - standardOutput = commitStdout - commandLine("git", "rev-parse", "HEAD") +sourceSets { + main { + blossom { + javaSources { + property("version", "$version") + property("git-commit", indraGit.commit().toString()) + } + } } - commit = "$commitStdout".replace("\n", "") // for some reason it adds new line so remove it. - commitStdout.close() - replaceToken("@git_commit@", commit) } - java { withJavadocJar() withSourcesJar() diff --git a/api/src/main/java/com/imaginarycode/minecraft/redisbungee/Constants.java b/api/src/main/java/com/imaginarycode/minecraft/redisbungee/Constants.java index 3188bac..3c79f83 100644 --- a/api/src/main/java/com/imaginarycode/minecraft/redisbungee/Constants.java +++ b/api/src/main/java/com/imaginarycode/minecraft/redisbungee/Constants.java @@ -13,8 +13,8 @@ package com.imaginarycode.minecraft.redisbungee; public class Constants { - public final static String VERSION = "@version@"; - public final static String GIT_COMMIT = "@git_commit@"; + public final static String VERSION = "{{ version }}"; + public final static String GIT_COMMIT = "{{ git-commit }}"; public static String getGithubCommitLink() { return "https://github.com/ProxioDev/ValioBungee/commit/" + GIT_COMMIT;