Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55382c6c authored by Nan Zhang's avatar Nan Zhang Committed by android-build-merger
Browse files

Merge "Add more options in droiddoc.go" am: dd41d7d6

am: 9b54e8be

Change-Id: I6f66930890b68f062ea60c1de8c27060bcad89b6
parents 90716d58 9b54e8be
Loading
Loading
Loading
Loading
+42 −2
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@ var (
				`$opts $bootclasspathArgs $classpathArgs -sourcepath $sourcepath ` +
				`$opts $bootclasspathArgs $classpathArgs -sourcepath $sourcepath ` +
				`-d $outDir -quiet  && ` +
				`-d $outDir -quiet  && ` +
				`${config.SoongZipCmd} -write_if_changed -d -o $docZip -C $outDir -D $outDir && ` +
				`${config.SoongZipCmd} -write_if_changed -d -o $docZip -C $outDir -D $outDir && ` +
				`${config.SoongZipCmd} -write_if_changed -jar -o $out -C $stubsDir -D $stubsDir`,
				`${config.SoongZipCmd} -write_if_changed -jar -o $out -C $stubsDir -D $stubsDir $postDoclavaCmds`,
			CommandDeps: []string{
			CommandDeps: []string{
				"${config.ZipSyncCmd}",
				"${config.ZipSyncCmd}",
				"${config.JavadocCmd}",
				"${config.JavadocCmd}",
@@ -45,7 +45,7 @@ var (
			Restat:         true,
			Restat:         true,
		},
		},
		"outDir", "srcJarDir", "stubsDir", "srcJars", "opts",
		"outDir", "srcJarDir", "stubsDir", "srcJars", "opts",
		"bootclasspathArgs", "classpathArgs", "sourcepath", "docZip")
		"bootclasspathArgs", "classpathArgs", "sourcepath", "docZip", "postDoclavaCmds")


	apiCheck = pctx.AndroidStaticRule("apiCheck",
	apiCheck = pctx.AndroidStaticRule("apiCheck",
		blueprint.RuleParams{
		blueprint.RuleParams{
@@ -201,6 +201,16 @@ type DroiddocProperties struct {
	// names of the output files used in args that will be generated
	// names of the output files used in args that will be generated
	Out []string
	Out []string


	// if set to true, collect the values used by the Dev tools and
	// write them in files packaged with the SDK. Defaults to false.
	Write_sdk_values *bool

	// index.html under current module will be copied to docs out dir, if not null.
	Static_doc_index_redirect *string

	// source.properties under current module will be copied to docs out dir, if not null.
	Static_doc_properties *string

	// a list of files under current module source dir which contains known tags in Java sources.
	// a list of files under current module source dir which contains known tags in Java sources.
	// filegroup or genrule can be included within this property.
	// filegroup or genrule can be included within this property.
	Knowntags []string
	Knowntags []string
@@ -629,6 +639,14 @@ func (d *Droiddoc) DepsMutator(ctx android.BottomUpMutatorContext) {
	// knowntags may contain filegroup or genrule.
	// knowntags may contain filegroup or genrule.
	android.ExtractSourcesDeps(ctx, d.properties.Knowntags)
	android.ExtractSourcesDeps(ctx, d.properties.Knowntags)


	if String(d.properties.Static_doc_index_redirect) != "" {
		android.ExtractSourceDeps(ctx, d.properties.Static_doc_index_redirect)
	}

	if String(d.properties.Static_doc_properties) != "" {
		android.ExtractSourceDeps(ctx, d.properties.Static_doc_properties)
	}

	if d.checkCurrentApi() {
	if d.checkCurrentApi() {
		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Api_file)
		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Api_file)
		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Removed_api_file)
		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Removed_api_file)
@@ -876,6 +894,27 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
			opts += " -stubs " + android.PathForModuleOut(ctx, "docs", "stubsDir").String()
			opts += " -stubs " + android.PathForModuleOut(ctx, "docs", "stubsDir").String()
		}
		}


		if Bool(d.properties.Write_sdk_values) {
			opts += " -sdkvalues " + android.PathForModuleOut(ctx, "docs").String()
		}

		var postDoclavaCmds string
		if String(d.properties.Static_doc_index_redirect) != "" {
			static_doc_index_redirect := ctx.ExpandSource(String(d.properties.Static_doc_index_redirect),
				"static_doc_index_redirect")
			implicits = append(implicits, static_doc_index_redirect)
			postDoclavaCmds += " && cp " + static_doc_index_redirect.String() + " " +
				android.PathForModuleOut(ctx, "docs", "out", "index.html").String()
		}

		if String(d.properties.Static_doc_properties) != "" {
			static_doc_properties := ctx.ExpandSource(String(d.properties.Static_doc_properties),
				"static_doc_properties")
			implicits = append(implicits, static_doc_properties)
			postDoclavaCmds += " && cp " + static_doc_properties.String() + " " +
				android.PathForModuleOut(ctx, "docs", "out", "source.properties").String()
		}

		ctx.Build(pctx, android.BuildParams{
		ctx.Build(pctx, android.BuildParams{
			Rule:            javadoc,
			Rule:            javadoc,
			Description:     "Droiddoc",
			Description:     "Droiddoc",
@@ -893,6 +932,7 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
				"classpathArgs":     classpathArgs,
				"classpathArgs":     classpathArgs,
				"sourcepath":        strings.Join(d.Javadoc.sourcepaths.Strings(), ":"),
				"sourcepath":        strings.Join(d.Javadoc.sourcepaths.Strings(), ":"),
				"docZip":            d.Javadoc.docZip.String(),
				"docZip":            d.Javadoc.docZip.String(),
				"postDoclavaCmds":   postDoclavaCmds,
			},
			},
		})
		})
	} else {
	} else {