Skip to content

Commit 6ee1512

Browse files
committed
Add jar copying tasks
1 parent c9843e0 commit 6ee1512

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ val versionString =
4545

4646
version = versionString
4747

48+
base.archivesName = "modernfix-forge"
49+
4850
legacyForge {
4951
enable {
5052
forgeVersion = rootProject.properties["forge_version"].toString()
@@ -177,4 +179,22 @@ tasks.named<ProcessResources>("processResources") {
177179
filesMatching("META-INF/mods.toml") {
178180
expand("version" to project.version)
179181
}
182+
}
183+
184+
val finalJarTask = "reobfJar"
185+
186+
tasks.register<Copy>("copyJarNameConsistent") {
187+
from(tasks.named<Jar>(finalJarTask).get().outputs.files)
188+
into(project.file("build/libs"))
189+
rename { name -> "modernfix-" + project.name + "-latest.jar" }
190+
}
191+
192+
tasks.register<Copy>("copyJarToBin") {
193+
from(tasks.named<Jar>(finalJarTask).get().outputs.files)
194+
into(rootProject.file("bin"))
195+
mustRunAfter(tasks.named("copyJarNameConsistent"))
196+
}
197+
198+
tasks.named("build") {
199+
dependsOn("copyJarToBin", "copyJarNameConsistent")
180200
}

0 commit comments

Comments
 (0)