diff --git a/build.gradle b/build.gradle index 7de9e8fc0..ecccaa6be 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,17 @@ allprojects { return os.toString().trim() } } + + getCurrentShortRevision = { + new ByteArrayOutputStream().withStream { os -> + exec { + executable = "git" + args = ["rev-parse", "HEAD"] + standardOutput = os + } + return os.toString().trim().substring(0, 8) + } + } } repositories { diff --git a/proxy/build.gradle b/proxy/build.gradle index 547faed22..56507cb0a 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -14,8 +14,11 @@ compileTestJava { jar { manifest { + def buildNumber = System.getenv("BUILD_NUMBER") ?: "unknown" + def version = "${project.version} (git-${project.ext.getCurrentShortRevision()}, build ${buildNumber})" + attributes 'Main-Class': 'com.velocitypowered.proxy.Velocity' - attributes 'Implementation-Version': project.version + attributes 'Implementation-Version': version } }