mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-19 09:07:06 +00:00
include branch / commit hash in the constants
This commit is contained in:
parent
a8bd655ef5
commit
693b7e6d71
@ -1,7 +1,10 @@
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("net.kyori.blossom") version "1.2.0"
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -28,8 +31,21 @@ description = "RedisBungee interafaces"
|
||||
|
||||
blossom {
|
||||
replaceToken("@version@", "$version")
|
||||
// replaceToken("@git_branch@", "")
|
||||
// replaceToken("@git_commit@", "")
|
||||
// GIT
|
||||
val branchStdout = ByteArrayOutputStream()
|
||||
rootProject.exec {
|
||||
standardOutput = branchStdout
|
||||
commandLine("git", "branch", "--show-current")
|
||||
}
|
||||
val commitStdout = ByteArrayOutputStream()
|
||||
rootProject.exec {
|
||||
standardOutput = commitStdout
|
||||
commandLine("git", "rev-parse", "HEAD")
|
||||
}
|
||||
replaceToken("@git_branch@", "$branchStdout".replace("\n", ""))
|
||||
replaceToken("@git_commit@", "$commitStdout".replace("\n", ""))
|
||||
branchStdout.close()
|
||||
commitStdout.close()
|
||||
}
|
||||
|
||||
java {
|
||||
|
@ -3,11 +3,7 @@ package com.imaginarycode.minecraft.redisbungee;
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "@version@";
|
||||
|
||||
// public final static String GIT_BRANCH = "@git_branch@";
|
||||
|
||||
// public final static String GIT_COMMIT = "@git_commit@";
|
||||
|
||||
|
||||
public final static String GIT_BRANCH = "@git_branch@";
|
||||
public final static String GIT_COMMIT = "@git_commit@";
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user