From 3a7b3b35c32fbd0330ec450e381aac7024360c60 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 12 Jun 2021 18:28:41 -0700 Subject: [PATCH] Write API version to pom.properties for Versioning to read Maven writes this metadata normally, but we don't use maven. Maybe should modify Versioning instead in the future, but this works just fine for now. --- gradle.properties | 2 +- patches/api/Convert-project-to-Gradle.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 31b305761..071cb6fb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -group = "io.papermc.paper" +group = io.papermc.paper version = 1.17-R0.1-SNAPSHOT mcVersion = 1.17 diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 34d75bd8b..b72a8aaeb 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -20,6 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +0,0 @@ ++import java.util.Locale ++ +plugins { + `java-library` + checkstyle @@ -53,7 +55,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + checkstyle("com.puppycrawl.tools:checkstyle:8.39") +} + ++val generateApiVersioningFile by tasks.registering { ++ val pomProps = layout.buildDirectory.file("pom.properties") ++ outputs.file(pomProps) ++ doLast { ++ pomProps.get().asFile.writeText("version=${project.version}") ++ } ++} ++ +tasks.jar { ++ from(generateApiVersioningFile.map { it.outputs.files.singleFile }) { ++ into("META-INF/maven/${project.group}/${project.name.toLowerCase(Locale.ENGLISH)}") ++ } + manifest { + attributes += mapOf( + "Automatic-Module-Name" to "org.bukkit"