From 39c1679e693af409eb4ea44c2a8aa4b93ea25b46 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 24 Jan 2019 16:32:44 -0800 Subject: [PATCH] Fix conflicting srcjar dir for current and last apicheck Each rule needs its own srcJarDir. Bug: 123222452 Test: m checkbuild Change-Id: I23c62b75c7532eca9320b12235a102141d6eeefa --- java/droiddoc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index babde55c2..ef9100988 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -1570,7 +1570,7 @@ func (d *Droidstubs) transformMetalava(ctx android.ModuleContext, implicits andr 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 @@ func (d *Droidstubs) transformCheckApi(ctx android.ModuleContext, 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 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) { 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 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) { 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`+