Commit 8b05f09e authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

#896 updated zipping task to support assets optimalization

parent ceae938c
......@@ -263,6 +263,24 @@ def hasAtlasDir(File file) {
task zipAssets(dependsOn: [prepareSoundAssets, prepareGraphicAssets, prepareJsonAssets]) {
doLast {
if (project.hasProperty('TABLEXIA_ASSETS_OPTIMIZE') && Boolean.valueOf(TABLEXIA_ASSETS_OPTIMIZE).booleanValue()) {
println "Atlases Optimizing: ENABLED."
def assetsDir = new File("${buildDir}/${assetsDirName}/")
println "Atlases Optimizing: START."
new File("${assetsDir.absolutePath}/${assetsDestinationDirName}/").eachDir() { dir ->
dir.eachFileRecurse() { file ->
if (file.name.endsWith(".png") && !file.absolutePath.contains("excluded")) {
exec {
commandLine 'pngquant', '--ext', '.png', '-f', 256, file.absolutePath
}
}
}
println "Atlases Optimizing: FINISH."
}
} else {
println "Atlases Optimizing: DISABLED."
}
new File(project(":core").projectDir.absolutePath + "/${assetsDirName}").eachDir() { dir ->
if (!dir.name.equals('common')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment