mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-29 03:31:27 +01:00
[ci skip] Use commit timestamp instead of build time in manifest (#6161)
This commit is contained in:
parent
67e2594825
commit
713b774a85
@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -0,0 +0,0 @@ tasks.jar {
|
@@ -0,0 +0,0 @@ tasks.jar {
|
||||||
val git = Git(rootProject.layout.projectDirectory.path)
|
|
||||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
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
|
+ val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
|
@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||||
- Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
|
- Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
|
||||||
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||||
|
|
||||||
Calendar deadline = Calendar.getInstance();
|
Calendar deadline = Calendar.getInstance();
|
||||||
deadline.add(Calendar.DAY_OF_YEAR, -7);
|
deadline.add(Calendar.DAY_OF_YEAR, -7);
|
||||||
|
@ -72,11 +72,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ val git = Git(rootProject.layout.projectDirectory.path)
|
+ val git = Git(rootProject.layout.projectDirectory.path)
|
||||||
+ val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
+ val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||||
+ val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
+ val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||||
|
+ val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||||
+ attributes(
|
+ attributes(
|
||||||
+ "Main-Class" to "org.bukkit.craftbukkit.Main",
|
+ "Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
+ "Implementation-Title" to "CraftBukkit",
|
+ "Implementation-Title" to "CraftBukkit",
|
||||||
+ "Implementation-Version" to "git-Paper-$implementationVersion",
|
+ "Implementation-Version" to "git-Paper-$implementationVersion",
|
||||||
+ "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper
|
+ "Implementation-Vendor" to date, // Paper
|
||||||
+ "Specification-Title" to "Bukkit",
|
+ "Specification-Title" to "Bukkit",
|
||||||
+ "Specification-Version" to project.version,
|
+ "Specification-Version" to project.version,
|
||||||
+ "Specification-Vendor" to "Bukkit Team",
|
+ "Specification-Vendor" to "Bukkit Team",
|
||||||
|
Loading…
Reference in New Issue
Block a user