Unzip apk in $(genDir) instead of inside source tree

Android source tree will eventually be made ReadOnly with /tmp and /out
as ReadWrite directories
This CL will ensure that the file extracted during the test will be written to
the sandbox dir $(genDir) instead of $TOP
Formatting changes are due to bpfmt

Bug: 174726238
Test: Built a target in git_master in a RO source tree
1. Before CL, we get this error "error:  cannot create resources.arsc
        Read-only file system"
2. After CL, the above error is fixed

Change-Id: I012284a5835603c54bc2a8bde585a01a4325c43a
This commit is contained in:
Spandan Das
2021-06-17 19:15:09 +00:00
parent 05081aa3b0
commit 808a4f2999

View File

@@ -23,15 +23,15 @@ package {
android_test_helper_app {
name: "LargeResourcesCompressed",
static_libs: [ "androidx.appcompat_appcompat" ],
static_libs: ["androidx.appcompat_appcompat"],
}
genrule {
name: "LargeResourcesUncompressed",
srcs: [ ":LargeResourcesCompressed" ],
srcs: [":LargeResourcesCompressed"],
out: ["LargeResourcesUncompressed.apk"],
cmd: "cp $(in) $(out) && unzip -o $(out) resources.arsc"
+ " && zip $(out) resources.arsc"
cmd: "cp $(in) $(out) && unzip -o $(out) resources.arsc -d $(genDir)" +
" && zip -j $(out) $(genDir)/resources.arsc",
}
java_library {