From e33ed8939ffbbe0a8893e846a4cfa3cbb10c8fad Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Sat, 26 Jun 2021 22:15:13 -0500 Subject: [PATCH] Get short commit ref using a more proper method --- patches/server/0001-Setup-Gradle-project.patch | 4 ++-- .../server/0719-Add-git-branch-and-commit-to-manifest.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index 3bd5e56636..fad345327c 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -20,7 +20,7 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..9b738b8561f75a2531d64abb36f4cd9d9561cbfc +index 0000000000000000000000000000000000000000..6e5431276a68204ab7aee451b2074afc371068b5 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,135 @@ @@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..9b738b8561f75a2531d64abb36f4cd9d + + manifest { + val git = Git(rootProject.layout.projectDirectory.path) -+ val gitHash = git("rev-parse", "HEAD").getText().substring(0, 7) ++ val gitHash = git("rev-parse", "--short=7", "HEAD").getText() + val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" + attributes( + "Main-Class" to "org.bukkit.craftbukkit.Main", diff --git a/patches/server/0719-Add-git-branch-and-commit-to-manifest.patch b/patches/server/0719-Add-git-branch-and-commit-to-manifest.patch index 0416423cc5..916c508625 100644 --- a/patches/server/0719-Add-git-branch-and-commit-to-manifest.patch +++ b/patches/server/0719-Add-git-branch-and-commit-to-manifest.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add git branch and commit to manifest diff --git a/build.gradle.kts b/build.gradle.kts -index e4d1fe13d541fb0e7eee81607d9651cdf7032cb0..39beb0331282b297f4f3857560d24ce6a616210d 100644 +index 2172b842ecd76a34d19fcaa54e087cc5b9ab8d7f..ff58e15e559c48d0dcf049e1b7708b71c0b789b6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -78,6 +78,7 @@ tasks.jar { val git = Git(rootProject.layout.projectDirectory.path) - val gitHash = git("rev-parse", "HEAD").getText().substring(0, 7) + val gitHash = git("rev-parse", "--short=7", "HEAD").getText() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" + val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes(