summaryrefslogtreecommitdiff
path: root/java/builder.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-11-21 15:13:56 -0800
committer Colin Cross <ccross@android.com> 2023-11-29 10:31:13 -0800
commit312634eb0fd02c2e084a6925c4f00e5fc00fca54 (patch)
treed267881b91fc694eda19bd6dabe961c3c1e56225 /java/builder.go
parent80117e6c4fc10412f9a313eb6391546e2da3ee1a (diff)
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
Diffstat (limited to 'java/builder.go')
-rw-r--r--java/builder.go19
1 files changed, 19 insertions, 0 deletions
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 {