mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 15:19:24 +07:00
55 lines
1.2 KiB
Groovy
55 lines
1.2 KiB
Groovy
apply plugin: "java"
|
|
|
|
sourceCompatibility = 1.8
|
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
|
|
import com.badlogic.gdx.tools.texturepacker.TexturePacker
|
|
|
|
def textureFolder = "../core/assets-raw/sprites/generated/"
|
|
|
|
task pack(){
|
|
dependsOn 'prePack'
|
|
|
|
doLast {
|
|
TexturePacker.process("core/assets-raw/sprites/", "core/assets/sprites/", "sprites.atlas")
|
|
|
|
delete{
|
|
delete textureFolder
|
|
}
|
|
}
|
|
}
|
|
|
|
task prePack(){
|
|
dependsOn "cleanup"
|
|
|
|
doLast{
|
|
TexturePacker.process("core/assets-raw/sprites/", "core/assets/sprites/", "sprites.atlas")
|
|
}
|
|
|
|
finalizedBy 'generateSprites'
|
|
}
|
|
|
|
task cleanup(){
|
|
delete{
|
|
delete textureFolder
|
|
}
|
|
}
|
|
|
|
task generateSprites(dependsOn: classes, type: JavaExec) {
|
|
file(textureFolder).mkdirs()
|
|
|
|
main = "io.anuke.mindustry.PackerLauncher"
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
standardInput = System.in
|
|
workingDir = textureFolder
|
|
}
|
|
|
|
task fixBundles(dependsOn: classes, type: JavaExec) {
|
|
file(textureFolder).mkdirs()
|
|
|
|
main = "io.anuke.mindustry.BundleLauncher"
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
standardInput = System.in
|
|
workingDir = "../core/assets/bundles/"
|
|
}
|