Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 4ffad4d

Browse files
committed
Add Jenkins build number
1 parent e13048f commit 4ffad4d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 524a455fb2955460a7499d47d494c63cd67a36ca Mon Sep 17 00:00:00 2001
2+
From: Peridot <[email protected]>
3+
Date: Mon, 24 Oct 2022 11:24:32 +0200
4+
Subject: [PATCH] Add Jenkins build number
5+
6+
7+
diff --git a/build.gradle b/build.gradle
8+
index bd42eafb..f6846890 100644
9+
--- a/build.gradle
10+
+++ b/build.gradle
11+
@@ -74,7 +74,16 @@ jar {
12+
def details = versionDetails()
13+
def gitBranch = details.branchName
14+
def gitHash = details.gitHash
15+
- def implementationVersion = System.getenv("GITHUB_RUN_NUMBER") ?: gitHash
16+
+
17+
+ String implementationVersion = gitHash;
18+
+ String ghBuildNumber = System.getenv("GITHUB_RUN_NUMBER");
19+
+ String jenkinsBuildNumber = System.getenv("BUILD_NUMBER");
20+
+ if (ghBuildNumber != null) {
21+
+ implementationVersion = "${ghBuildNumber}-GH";
22+
+ } else if (jenkinsBuildNumber != null) {
23+
+ implementationVersion = "${jenkinsBuildNumber}-JENKINS";
24+
+ }
25+
+
26+
attributes(
27+
"Main-Class": "org.bukkit.craftbukkit.Main",
28+
"Implementation-Title": "CraftBukkit",
29+
@@ -85,7 +94,8 @@ jar {
30+
"Specification-Vendor": "Bukkit Team",
31+
"Multi-Release": "true", // PandaSpigot
32+
"Git-Branch": gitBranch,
33+
- "Git-Commit": gitHash
34+
+ "Git-Commit": gitHash,
35+
+ "Build-Number": implementationVersion,
36+
)
37+
}
38+
}
39+
\ No newline at end of file
40+
--
41+
2.36.0.windows.1
42+

0 commit comments

Comments
 (0)