Commit 9ea7c216 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch '896-optimalizovat-atlasy-behem-buildu' into 'V3.6.3'

Resolve "Optimalizovat atlasy behem buildu"

See merge request !711
parents 9e4aabb1 6ca952e2
......@@ -25,7 +25,7 @@ pre-release:
- master
- devel
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
paths:
- android/build/outputs/apk/*debug*.apk
......@@ -43,7 +43,7 @@ debug:
- pre-release
- release
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
expire_in: 2 weeks
paths:
......@@ -71,7 +71,7 @@ release:
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
paths:
- android/build/outputs/apk/*release*.apk
......
......@@ -209,6 +209,7 @@ task prepareHdAssets(dependsOn: prepareAssets) {
inputs.dir(hdSourceDir.absolutePath)
inputs.dir(sourceDir.absolutePath)
outputs.dir("${buildDir}/${assetsDirName}/${assetsHdDirName}/${assetsSourceDirName}/")
doLast {
......@@ -306,6 +307,25 @@ task prepareGraphicAssets(dependsOn: prepareAssets) {
}
}
}
//optimizing for uploading
if (project.hasProperty('TABLEXIA_ASSETS_OPTIMIZE') && Boolean.valueOf(TABLEXIA_ASSETS_OPTIMIZE).booleanValue()) {
println "ASSETS OPTIMIZATION: ENABLED."
println "ASSETS OPTIMIZATION: START."
new File("${assetsDir.absolutePath}/${assetsDestinationDirName}/").eachDir() { dir ->
dir.eachFileRecurse() { file ->
if (file.name.endsWith(".png") && !file.absolutePath.contains("excluded")) {
println "Optimizing: ${file.name}"
exec {
commandLine 'pngquant', '--ext', '.png', '--nofs', '-f', 256, file.absolutePath
}
}
}
}
println "ASSETS OPTIMIZATION: FINISH."
} else {
println "ASSETS OPTIMIZATION NOT CONFIGURED -> SKIPPING OPTIMIZATION"
}
}
}
......@@ -387,6 +407,23 @@ task prepareHdGraphicAssets(dependsOn: prepareHdAssets) {
}.execute()
}
}
} //optimizing for uploading
if (project.hasProperty('TABLEXIA_ASSETS_OPTIMIZE') && Boolean.valueOf(TABLEXIA_ASSETS_OPTIMIZE).booleanValue()) {
println "HD ASSETS OPTIMIZATION: ENABLED."
println "HD ASSETS OPTIMIZATION: START."
new File("${assetsDir.absolutePath}/${assetsDestinationDirName}/").eachDir() { dir ->
dir.eachFileRecurse() { file ->
if (file.name.endsWith(".png") && !file.absolutePath.contains("excluded")) {
println "Optimizing: ${file.name}"
exec {
commandLine 'pngquant', '--ext', '.png', '--nofs', '-f', 256, file.absolutePath
}
}
}
}
println "HD ASSETS OPTIMIZATION: FINISH."
} else {
println "ASSETS OPTIMIZATION NOT CONFIGURED -> SKIPPING OPTIMIZATION"
}
} else {
println "HD PACK IS NOT REQUESTED"
......@@ -642,8 +679,8 @@ project(":core") {
compile "com.getsentry.raven:raven:$ravenVersion"
testCompile "junit:junit:4.11"
testCompile "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
}
......
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