diff --git a/build.gradle b/build.gradle index 51f1e798..186076f6 100644 --- a/build.gradle +++ b/build.gradle @@ -155,26 +155,21 @@ installDist { } task processSource(type: Sync) { - def date = new Date().format("d MMM yyyy") def gitOutput = new ByteArrayOutputStream() exec { - commandLine 'git', 'describe' + commandLine 'git', 'rev-parse', '--short', 'HEAD' standardOutput = gitOutput errorOutput = new ByteArrayOutputStream() ignoreExitValue = true } - def description = date - def tag = gitOutput.toString().trim() - - // TODO: Implement extended description in Java code - if (tag) description = "$tag; $description" - from 'src' filter { - line -> line.replaceAll('__builddate__', date) + line -> line + .replaceAll('__builddate__', new Date().format("d MMM yyyy")) + .replaceAll('__commithash__', gitOutput.toString().trim()) } into "${project.buildDir}/src" } diff --git a/src/main/java/helma/main/Server.java b/src/main/java/helma/main/Server.java index 4966551c..b747f11e 100644 --- a/src/main/java/helma/main/Server.java +++ b/src/main/java/helma/main/Server.java @@ -36,7 +36,13 @@ import helma.util.ResourceProperties; */ public class Server implements Runnable { // version string - public static final String version = "🐜 (__builddate__)"; + public static final String version = "🐜"; + + // build date + public static final String buildDate = "__builddate__"; + + // commit hash + public static final String commitHash = "__commithash__"; // static server instance private static Server server;