summaryrefslogtreecommitdiff
path: root/java/builder.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2019-09-05 16:44:18 -0700
committer Colin Cross <ccross@android.com> 2019-09-05 16:49:11 -0700
commit3b706fde7f3ce35a3a8d06de86aa0f9718406f5b (patch)
treebe1e07a65565668075c7b3d6c0eb4ba911dd1465 /java/builder.go
parentc3233c291f1b53bc7a609fa7b9a4505462d21583 (diff)
Shard kythe invocations when javac is sharded
The kythe pipeline has trouble injesting all 6000 files of framework.jar at once. Shared invocations of the kythe extractor when javac is sharded to produce multiple smaller kzip files. Bug: 140426870 Test: no change to build.ninja Test: m out/soong/.intermediates/frameworks/base/framework/android_common/framework0.kzip Test: TestSharding in java_test.go Change-Id: I867db4ef5cb1e7f3ce8359a46aac2c00ed8a8912
Diffstat (limited to 'java/builder.go')
-rw-r--r--java/builder.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/builder.go b/java/builder.go
index f174cf0c6..9e068fa64 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -229,10 +229,9 @@ func RunErrorProne(ctx android.ModuleContext, outputFile android.WritablePath,
// Emits the rule to generate Xref input file (.kzip file) for the given set of source files and source jars
// to compile with given set of builder flags, etc.
-func emitXrefRule(ctx android.ModuleContext, xrefFile android.WritablePath,
+func emitXrefRule(ctx android.ModuleContext, xrefFile android.WritablePath, idx int,
srcFiles, srcJars android.Paths,
- flags javaBuilderFlags, deps android.Paths,
- intermediatesDir string) {
+ flags javaBuilderFlags, deps android.Paths) {
deps = append(deps, srcJars...)
@@ -260,6 +259,11 @@ func emitXrefRule(ctx android.ModuleContext, xrefFile android.WritablePath,
processor = "-processor " + flags.processor
}
+ intermediatesDir := "xref"
+ if idx >= 0 {
+ intermediatesDir += strconv.Itoa(idx)
+ }
+
ctx.Build(pctx,
android.BuildParams{
Rule: kytheExtract,