Skip to content

Commit

Permalink
include an install task in the gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jan 7, 2025
1 parent 9916f17 commit 923b007
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import arc.files.Fi
import arc.util.*
import arc.util.serialization.*
import de.undercouch.gradle.tasks.download.Download
Expand Down Expand Up @@ -234,4 +235,17 @@ project(":"){
classpath(files("$rootDir/run/Mindustry.jar"))
mainClass.set("mindustry.desktop.DesktopLauncher")
}

tasks.register<DefaultTask>("install"){
dependsOn("jar")
doLast{
val folder = Fi.get(OS.getAppDataDirectoryString("Mindustry")).child("mods")
folder.mkdirs()

val input = Fi.get("$rootDir/build/libs/${project.name}Desktop.jar")
folder.child(input.name()).delete()
input.copyTo(folder)
logger.lifecycle("Copied :jar output to $folder.")
}
}
}

0 comments on commit 923b007

Please sign in to comment.