From 30963749fd68084f80631a6fd45732bee9aa4e7e Mon Sep 17 00:00:00 2001 From: Nan Zhang Date: Mon, 23 Apr 2018 09:59:14 -0700 Subject: [PATCH] Fix the undefined CommandDeps for standard Javadoc When compiling against without customized doclet, Javadoc doesn't need to depend on Doclava and Jsilver jars. Originally, we leave these two jars empty in Args so that CommandDeps won't have these two dependencies. But Ninja doesn't like that with errors: ninja: error: build.ninja: empty path because $Jsilver and $Doclava is undefined when compiling Javadoc. Test: m -j platform_library-docs Bug: b/70351683 Change-Id: I02fee181490f91e87a1feac74f3a69b5b4acb528 --- java/droiddoc.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index a29f0ba7b..4dd5fbb03 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -38,15 +38,13 @@ var ( "${config.ZipSyncCmd}", "${config.JavadocCmd}", "${config.SoongZipCmd}", - "$JsilverJar", - "$DoclavaJar", }, Rspfile: "$out.rsp", RspfileContent: "$in", Restat: true, }, "outDir", "srcJarDir", "stubsDir", "srcJars", "opts", - "bootclasspathArgs", "classpathArgs", "sourcepath", "docZip", "JsilverJar", "DoclavaJar") + "bootclasspathArgs", "classpathArgs", "sourcepath", "docZip") ) func init() { @@ -577,8 +575,13 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { implicits = append(implicits, d.Javadoc.srcJars...) + jsilver := android.PathForOutput(ctx, "host", ctx.Config().PrebuiltOS(), "framework", "jsilver.jar") + doclava := android.PathForOutput(ctx, "host", ctx.Config().PrebuiltOS(), "framework", "doclava.jar") + implicits = append(implicits, jsilver) + implicits = append(implicits, doclava) + opts := "-source 1.8 -J-Xmx1600m -J-XX:-OmitStackTraceInFastThrow -XDignore.symbol.file " + - "-doclet com.google.doclava.Doclava -docletpath ${config.JsilverJar}:${config.DoclavaJar} " + + "-doclet com.google.doclava.Doclava -docletpath " + jsilver.String() + ":" + doclava.String() + " " + "-templatedir " + templateDir + " " + htmlDirArgs + " " + htmlDir2Args + " " + "-hdf page.build " + ctx.Config().BuildId() + "-" + ctx.Config().BuildNumberFromFile() + " " + "-hdf page.now " + `"$$(date -d @$$(cat ` + ctx.Config().Getenv("BUILD_DATETIME_FILE") + `) "+%d %b %Y %k:%M")"` + @@ -609,8 +612,6 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { "classpathArgs": classpathArgs, "sourcepath": strings.Join(d.Javadoc.sourcepaths.Strings(), ":"), "docZip": d.Javadoc.docZip.String(), - "JsilverJar": "${config.JsilverJar}", - "DoclavaJar": "${config.DoclavaJar}", }, }) }