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
fa637ed8dd
commit
672c5365f4
7 changed files with 26 additions and 13 deletions
|
@ -16,10 +16,12 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4
|
|||
/.project
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a0f1c1d1ac63fdcce942922ffe68a8d44c712513
|
||||
index 0000000000000000000000000000000000000000..f3dd92e136a71aa39e422de7b2c5f2f3fdec554e
|
||||
--- /dev/null
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +1,54 @@
|
||||
@@ -0,0 +1,67 @@
|
||||
+import java.util.Locale
|
||||
+
|
||||
+plugins {
|
||||
+ `java-library`
|
||||
+ checkstyle
|
||||
|
@ -53,7 +55,18 @@ index 0000000000000000000000000000000000000000..a0f1c1d1ac63fdcce942922ffe68a8d4
|
|||
+ 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…
Add table
Add a link
Reference in a new issue