From 853f420ed76b5bae2df9966723bcbbd7927ca939 Mon Sep 17 00:00:00 2001 From: Nan Zhang Date: Thu, 12 Apr 2018 16:55:56 -0700 Subject: [PATCH] Add bool to control if we need generate stubs src files. Some modules only need the documentation instead of the stubs. And fix a small issue for arg name passed to standard javadoc. Test: m -j dx-docs and check the build.ninja Bug: b/70351683 Change-Id: Ic47c53db12db6f2632349e48c4a626a4f432f447 --- java/droiddoc.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index 3d279769e..0224da5ae 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -153,6 +153,9 @@ type DroiddocProperties struct { // the generated exact API filename by Doclava. Exact_api_filename *string + + // if set to false, don't allow droiddoc to generate stubs source files. Defaults to true. + Create_stubs *bool } type Javadoc struct { @@ -391,7 +394,7 @@ func (j *Javadoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { "stubsDir": android.PathForModuleOut(ctx, "docs", "stubsDir").String(), "srcJars": strings.Join(j.srcJars.Strings(), " "), "opts": opts, - "bootClasspathArgs": bootClasspathArgs, + "bootclasspathArgs": bootClasspathArgs, "classpathArgs": classpathArgs, "sourcepath": strings.Join(j.sourcepaths.Strings(), ":"), "docZip": j.docZip.String(), @@ -562,8 +565,11 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { "-doclet com.google.doclava.Doclava -docletpath ${config.JsilverJar}:${config.DoclavaJar} " + "-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")"` + " " + - args + " -stubs " + android.PathForModuleOut(ctx, "docs", "stubsDir").String() + "-hdf page.now " + `"$$(date -d @$$(cat ` + ctx.Config().Getenv("BUILD_DATETIME_FILE") + `) "+%d %b %Y %k:%M")"` + + " " + args + if BoolDefault(d.properties.Create_stubs, true) { + opts += " -stubs " + android.PathForModuleOut(ctx, "docs", "stubsDir").String() + } implicitOutputs = append(implicitOutputs, d.Javadoc.docZip) for _, o := range d.properties.Out {