Fix conflicting srcjar dir for current and last apicheck
Each rule needs its own srcJarDir.
Bug: 123222452
Test: m checkbuild
Change-Id: I23c62b75c7532eca9320b12235a102141d6eeefa
diff --git a/java/droiddoc.go b/java/droiddoc.go
index babde55..ef91009 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -1570,7 +1570,7 @@
func (d *Droidstubs) transformCheckApi(ctx android.ModuleContext,
apiFile, removedApiFile android.Path, implicits android.Paths,
- javaVersion, bootclasspathArgs, classpathArgs, sourcepathArgs, opts, msg string,
+ javaVersion, bootclasspathArgs, classpathArgs, sourcepathArgs, opts, subdir, msg string,
output android.WritablePath) {
ctx.Build(pctx, android.BuildParams{
Rule: metalavaApiCheck,
@@ -1580,7 +1580,7 @@
Implicits: append(android.Paths{apiFile, removedApiFile, d.apiFile, d.removedApiFile},
implicits...),
Args: map[string]string{
- "srcJarDir": android.PathForModuleOut(ctx, "apicheck-srcjars").String(),
+ "srcJarDir": android.PathForModuleOut(ctx, subdir, "srcjars").String(),
"srcJars": strings.Join(d.Javadoc.srcJars.Strings(), " "),
"javaVersion": javaVersion,
"bootclasspathArgs": bootclasspathArgs,
@@ -1669,7 +1669,7 @@
flags.metalavaInclusionAnnotationsFlags + flags.metalavaMergeAnnoDirFlags + " "
d.transformCheckApi(ctx, apiFile, removedApiFile, metalavaCheckApiImplicits,
- javaVersion, flags.bootClasspathArgs, flags.classpathArgs, flags.sourcepathArgs, opts,
+ javaVersion, flags.bootClasspathArgs, flags.classpathArgs, flags.sourcepathArgs, opts, "current-apicheck",
fmt.Sprintf(`\n******************************\n`+
`You have tried to change the API from what has been previously approved.\n\n`+
`To make these errors go away, you have two choices:\n`+
@@ -1700,7 +1700,7 @@
removedApiFile.String() + flags.metalavaMergeAnnoDirFlags + " "
d.transformCheckApi(ctx, apiFile, removedApiFile, metalavaCheckApiImplicits,
- javaVersion, flags.bootClasspathArgs, flags.classpathArgs, flags.sourcepathArgs, opts,
+ javaVersion, flags.bootClasspathArgs, flags.classpathArgs, flags.sourcepathArgs, opts, "last-apicheck",
`\n******************************\n`+
`You have tried to change the API from what has been previously released in\n`+
`an SDK. Please fix the errors listed above.\n`+