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 }