diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-13 10:39:29 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-13 10:49:11 +0100 |
commit | 02b6e75378e057b05e7405001ea05603f23430f5 (patch) | |
tree | 570d3200411cd381c8443f0e40a8ec198e7afe71 /build.gradle.kts | |
parent | e9d26be68e0a094e1edd6f1bf6a9b3e28fc30007 (diff) | |
download | LocalTransactionLedger-02b6e75378e057b05e7405001ea05603f23430f5.tar.gz LocalTransactionLedger-02b6e75378e057b05e7405001ea05603f23430f5.tar.bz2 LocalTransactionLedger-02b6e75378e057b05e7405001ea05603f23430f5.zip |
feat: Add git release to version number
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 54f4457..def2fdd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import org.apache.commons.lang3.SystemUtils +import java.io.ByteArrayOutputStream plugins { idea @@ -9,10 +10,21 @@ plugins { kotlin("jvm") version "2.0.20" } +fun cmd(vararg args: String): String { + val baos = ByteArrayOutputStream() + exec { + standardOutput = baos + commandLine(*args) + } + return baos.toByteArray().decodeToString() +} + + val baseGroup: String by project val mcVersion: String by project -val version: String by project +val version: String = project.property("mod_version").toString() + "-" + cmd("git", "rev-parse", "--short", "HEAD") val mixinGroup = "$baseGroup.mixin" +project.version = version val modid: String by project // Toolchains: |