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
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 3d27976..0224da5 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -153,6 +153,9 @@
// 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 @@
"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 @@
"-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 {