From 312634eb0fd02c2e084a6925c4f00e5fc00fca54 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 21 Nov 2023 15:13:56 -0800 Subject: Don't write transitive dependencies to Android-${TARGET_PRODUCT}.mk Java libraries were writing lists of files that changed whenever transitive dependencies changed to Android-${TARGET_PRODUCT}.mk, causing Kati analysis to rerun whenever a dependency was changed in Soong. In both cases, Make would immediately use the list to write a single output file. Write the files in Soong and pass the path to the file to Make instead, which will both reduce the size of Android-${TARGET_PRODUCT}.mk and skip Kati analysis more often. Bug: 309006256 Test: m checkbuild Change-Id: I5dff16c6fb7cca8c6da927b37c612c7b1d0954e6 --- java/builder.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'java/builder.go') diff --git a/java/builder.go b/java/builder.go index ee7e225a8..d03c8e50c 100644 --- a/java/builder.go +++ b/java/builder.go @@ -264,6 +264,16 @@ var ( Command: `${config.Zip2ZipCmd} -i ${in} -o ${out} -x 'META-INF/services/**/*'`, CommandDeps: []string{"${config.Zip2ZipCmd}"}, }) + + writeCombinedProguardFlagsFileRule = pctx.AndroidStaticRule("writeCombinedProguardFlagsFileRule", + blueprint.RuleParams{ + Command: `rm -f $out && ` + + `for f in $in; do ` + + ` echo && ` + + ` echo "# including $$f" && ` + + ` cat $$f; ` + + `done > $out`, + }) ) func init() { @@ -686,6 +696,15 @@ func TransformZipAlign(ctx android.ModuleContext, outputFile android.WritablePat }) } +func writeCombinedProguardFlagsFile(ctx android.ModuleContext, outputFile android.WritablePath, files android.Paths) { + ctx.Build(pctx, android.BuildParams{ + Rule: writeCombinedProguardFlagsFileRule, + Description: "write combined proguard flags file", + Inputs: files, + Output: outputFile, + }) +} + type classpath android.Paths func (x *classpath) formJoinedClassPath(optName string, sep string) string { -- cgit v1.2.3-59-g8ed1b