💚 Change name of output file (and for some reason, fix build?)
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Nov 2024 20:57:21 +0000 (21:57 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Nov 2024 20:57:21 +0000 (21:57 +0100)
build.gradle

index a9dfb0d..00dfc77 100644 (file)
@@ -65,7 +65,7 @@ dependencies {
 }
 
 tasks.register('fatJar', Jar) {
-    archiveBaseName.set(project.name + "-all")
+    archiveFileName.set(project.name + ".jar")
     manifest {
         attributes(
                 "Main-Class": "net.pterodactylus.rhynodge.engine.Starter"
@@ -83,22 +83,19 @@ tasks.named('test') {
     jvmArgs += "--add-opens=java.base/java.util=ALL-UNNAMED"
 }
 
-tasks.register('createVersion') {
-    processResources.dependsOn(createVersion)
+import org.ajoberstar.grgit.Grgit
+def createVersion() {
+    def gitRepo = Grgit.open(projectDir)
+    def version = gitRepo.describe()
+    println("created version dir: " + new File("src/generated/resources").mkdirs())
+    new File("src/generated/resources/version.txt").withWriter() { it.write(version) }
 }
 
 tasks.named("processGeneratedResources") {
-    duplicatesStrategy = DuplicatesStrategy.INCLUDE
-}
-
-import org.ajoberstar.grgit.Grgit
-createVersion {
-    doLast {
-        def gitRepo = Grgit.open(projectDir)
-        version = gitRepo.describe()
-        new File("src/generated/resources").mkdirs()
-        new File("src/generated/resources/version.txt").withWriter() { it.write(version) }
+    doFirst {
+        createVersion()
     }
+    duplicatesStrategy = DuplicatesStrategy.INCLUDE
 }
 
 jacoco {