Remove timestamps from genrule jars
Deterministic build outputs help improve RBE cache rates, which should
help build times both locally and in CI. `soong_zip` is deterministic by
default, unlike the `jar` tool.
Bug: 325124724
Test: zipinfo measure_io.jar before/after
Test: zipinfo authfs_test_apk_assets.jar before/after
Change-Id: I0255c8513a1bfbc07c221f8435b491d7528a2775
diff --git a/authfs/Android.bp b/authfs/Android.bp
index 8ac600d..e04d5e1 100644
--- a/authfs/Android.bp
+++ b/authfs/Android.bp
@@ -73,6 +73,7 @@
tools: [
"fsverity_manifest_generator",
"fsverity",
+ "soong_zip",
],
srcs: [
"testdata/input.4k",
@@ -85,13 +86,11 @@
* to load a generated fsverity manifest for the test input files into the
* test VM.
*/
- cmd: "out_dir=$$(dirname $(out))" +
- "&& assets_dir=\"assets\" " +
- "&& mkdir -p $$out_dir/$$assets_dir" +
+ cmd: "mkdir -p $(genDir)/assets" +
"&& $(location fsverity_manifest_generator) " +
" --fsverity-path $(location fsverity) " +
" --base-dir $$(dirname $(in) | head -1) " +
- " --output $$out_dir/$$assets_dir/input_manifest.pb " +
+ " --output $(genDir)/assets/input_manifest.pb " +
" $(in) " +
- "&& jar cf $(out) -C $$out_dir $$assets_dir",
+ "&& $(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)/assets",
}