aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0710-Add-git-branch-and-commit-to-manifest.patch
blob: 2294688387128554d7d71c005a05a1bb0572f9ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Professor Bloodstone <git@bloodstone.dev>
Date: Sun, 20 Jun 2021 01:14:41 +0200
Subject: [PATCH] Add git branch and commit to manifest


diff --git a/build.gradle.kts b/build.gradle.kts
index a744a8e5917ded1488f377d3ed2c30c41132a03d..35266258f7eddba51a6e2b334046954213d88237 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -60,6 +60,7 @@ tasks.jar {
         val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
         val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
         val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
+        val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
         attributes(
             "Main-Class" to "org.bukkit.craftbukkit.Main",
             "Implementation-Title" to "CraftBukkit",
@@ -69,6 +70,8 @@ tasks.jar {
             "Specification-Version" to project.version,
             "Specification-Vendor" to "Bukkit Team",
             "Multi-Release" to "true", // Paper
+            "Git-Branch" to gitBranch, // Paper
+            "Git-Commit" to gitHash, // Paper
         )
         for (tld in setOf("net", "com", "org")) {
             attributes("$tld/bukkit", "Sealed" to true)