mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 06:50:12 +01:00
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.
This commit is contained in:
parent
3d38374f46
commit
3a7b3b35c3
2 changed files with 14 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
group = "io.papermc.paper"
|
||||
group = io.papermc.paper
|
||||
version = 1.17-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.17
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue