Save resource path shortening map (#360)
This commit is contained in:
parent
82a8d87eb1
commit
8813122186
|
|
@ -84,7 +84,7 @@ jobs:
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: mappings
|
name: mappings
|
||||||
path: "core/build/outputs/mapping"
|
path: "core/build/outputs/mapping/release"
|
||||||
- name: Post to channel
|
- name: Post to channel
|
||||||
if: ${{ github.event_name != 'pull_request' && success() && github.ref == 'refs/heads/master' }}
|
if: ${{ github.event_name != 'pull_request' && success() && github.ref == 'refs/heads/master' }}
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ jobs:
|
||||||
- name: Upload mappings
|
- name: Upload mappings
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.buildRelease.outputs.releaseName }}-mappings
|
name: mappings
|
||||||
path: "app/build/outputs"
|
path: "app/build/outputs/mapping/release"
|
||||||
- name: Post to channel
|
- name: Post to channel
|
||||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -123,22 +123,29 @@ val optimizeReleaseRes = task("optimizeReleaseRes").doLast {
|
||||||
project.android.buildToolsVersion,
|
project.android.buildToolsVersion,
|
||||||
"aapt2"
|
"aapt2"
|
||||||
)
|
)
|
||||||
|
val mapping = Paths.get(
|
||||||
|
project.buildDir.path,
|
||||||
|
"outputs",
|
||||||
|
"mapping",
|
||||||
|
"release",
|
||||||
|
"shortening.txt"
|
||||||
|
)
|
||||||
val zip = Paths.get(
|
val zip = Paths.get(
|
||||||
project.buildDir.path,
|
project.buildDir.path,
|
||||||
"intermediates",
|
"intermediates",
|
||||||
"optimized_processed_res",
|
"shrunk_processed_res",
|
||||||
"release",
|
"release",
|
||||||
"resources-release-optimize.ap_"
|
"resources-release-stripped.ap_"
|
||||||
)
|
)
|
||||||
val optimized = File("${zip}.opt")
|
val optimized = File("${zip}.opt")
|
||||||
val cmd = exec {
|
val cmd = exec {
|
||||||
commandLine(
|
commandLine(
|
||||||
aapt2,
|
aapt2, "optimize",
|
||||||
"optimize",
|
|
||||||
"--collapse-resource-names",
|
"--collapse-resource-names",
|
||||||
"--enable-sparse-encoding",
|
"--enable-sparse-encoding",
|
||||||
"-o",
|
"--shorten-resource-paths",
|
||||||
optimized,
|
"--resource-path-shortening-map", mapping,
|
||||||
|
"-o", optimized,
|
||||||
zip
|
zip
|
||||||
)
|
)
|
||||||
isIgnoreExitValue = false
|
isIgnoreExitValue = false
|
||||||
|
|
@ -150,7 +157,7 @@ val optimizeReleaseRes = task("optimizeReleaseRes").doLast {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.whenTaskAdded {
|
tasks.whenTaskAdded {
|
||||||
if (name == "optimizeReleaseResources") {
|
if (name == "shrinkReleaseRes") {
|
||||||
finalizedBy(optimizeReleaseRes)
|
finalizedBy(optimizeReleaseRes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,4 @@
|
||||||
#Sat Jan 30 19:20:27 CST 202130.0.322.0.7026061
|
#Sat Jan 30 19:20:27 CST 202130.0.322.0.7026061
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
android.enableResourceOptimizations=false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue