I am attempting to create a gradle task which runs TexturePacker according to the instructions here. (Note that I am using Android Studio and its directory structure rather
I got it working by adding gdx-tools to my buildscript dependencies:
buildscript{
dependencies {
...
classpath 'com.badlogicgames.gdx:gdx-tools:1.5.4'
}
}
by doing this, my desktop's build.gradle was able to import the texture packer class:
import com.badlogic.gdx.tools.texturepacker.TexturePacker
task texturePacker << {
if (project.ext.has('texturePacker')) {
logger.info "Calling TexturePacker: "+ texturePacker
TexturePacker.process(texturePacker[0], texturePacker[1], texturePacker[2])
}
}
please note that your desktop project's ext will need to have texturePacker defined:
project.ext {
mainClassName = "your.game.package.DesktopLauncher"
assetsDir = new File("../android/assets");
texturePacker = ["../images/sprites", "../android/assets", "sprites"]
}