diff options
author | 2024-12-10 12:34:24 -0800 | |
---|---|---|
committer | 2024-12-10 13:54:49 -0800 | |
commit | b47760106f2d8acb17b786e3a5e444c3a11c4721 (patch) | |
tree | 9293394413077a0907946d7d95dbb4b50f359153 /java/builder.go | |
parent | dd7ac83fdaae8b8f0b61ac4bae1cc3c258b9629b (diff) |
Collect file delta metrics for java and kotlin compiles
- Update the kotlinc and javac build rules to generate changed file
metrics.
- Upload the aggregated metrics at build completion.
- Also fixes parsing of --inputs_file and --target to be consistent with
existing use cases.
Bug: b/365537477
Test: manual, TH
Change-Id: I48efe06917baa98081e18b6351b63a624b55dba8
Diffstat (limited to 'java/builder.go')
-rw-r--r-- | java/builder.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/java/builder.go b/java/builder.go index 895ddb6f9..01fbbddf5 100644 --- a/java/builder.go +++ b/java/builder.go @@ -46,6 +46,7 @@ var ( `mkdir -p "$outDir" "$annoDir" "$srcJarDir" && ` + `${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" $srcJars && ` + `(if [ -s $srcJarDir/list ] || [ -s $out.rsp ] ; then ` + + `${config.FindInputDeltaCmd} --template '' --target "$out" --inputs_file "$out.rsp" && ` + `${config.SoongJavacWrapper} $javaTemplate${config.JavacCmd} ` + `${config.JavacHeapFlags} ${config.JavacVmFlags} ${config.CommonJdkFlags} ` + `$processorpath $processor $javacFlags $bootClasspath $classpath ` + @@ -55,8 +56,10 @@ var ( `$zipTemplate${config.SoongZipCmd} -jar -o $out.tmp -C $outDir -D $outDir && ` + `if ! cmp -s "$out.tmp" "$out"; then mv "$out.tmp" "$out"; fi && ` + `if ! cmp -s "$annoSrcJar.tmp" "$annoSrcJar"; then mv "$annoSrcJar.tmp" "$annoSrcJar"; fi && ` + + `if [[ -f "$out.pc_state.new" ]]; then mv "$out.pc_state.new" "$out.pc_state"; fi && ` + `rm -rf "$srcJarDir" "$outDir"`, CommandDeps: []string{ + "${config.FindInputDeltaCmd}", "${config.JavacCmd}", "${config.SoongZipCmd}", "${config.ZipSyncCmd}", |