aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/androidmk.go3
-rw-r--r--java/droiddoc.go18
2 files changed, 20 insertions, 1 deletions
diff --git a/java/androidmk.go b/java/androidmk.go
index 5067e2f4..58b9b80f 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -534,6 +534,9 @@ func (dstubs *Droidstubs) AndroidMkEntries() android.AndroidMkEntries {
if dstubs.jdiffDocZip != nil {
entries.SetPath("LOCAL_DROIDDOC_JDIFF_DOC_ZIP", dstubs.jdiffDocZip)
}
+ if dstubs.metadataZip != nil {
+ entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip)
+ }
apiFilePrefix := "INTERNAL_PLATFORM_"
if String(dstubs.properties.Api_tag_name) != "" {
apiFilePrefix += String(dstubs.properties.Api_tag_name) + "_"
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 8a283cd5..025beab5 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -1193,6 +1193,9 @@ type Droidstubs struct {
jdiffDocZip android.WritablePath
jdiffStubsSrcJar android.WritablePath
+
+ metadataZip android.WritablePath
+ metadataDir android.WritablePath
}
// droidstubs passes sources files through Metalava to generate stub .java files that only contain the API to be
@@ -1304,7 +1307,8 @@ func (d *Droidstubs) stubsFlags(ctx android.ModuleContext, cmd *android.RuleBuil
}
if Bool(d.properties.Write_sdk_values) {
- cmd.FlagWithArg("--sdk-values ", android.PathForModuleOut(ctx, "out").String())
+ d.metadataDir = android.PathForModuleOut(ctx, "metadata")
+ cmd.FlagWithArg("--sdk-values ", d.metadataDir.String())
}
if Bool(d.properties.Create_doc_stubs) {
@@ -1511,6 +1515,18 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
FlagWithOutput("-o ", d.Javadoc.stubsSrcJar).
FlagWithArg("-C ", stubsDir.String()).
FlagWithArg("-D ", stubsDir.String())
+
+ if Bool(d.properties.Write_sdk_values) {
+ d.metadataZip = android.PathForModuleOut(ctx, ctx.ModuleName()+"-metadata.zip")
+ rule.Command().
+ BuiltTool(ctx, "soong_zip").
+ Flag("-write_if_changed").
+ Flag("-d").
+ FlagWithOutput("-o ", d.metadataZip).
+ FlagWithArg("-C ", d.metadataDir.String()).
+ FlagWithArg("-D ", d.metadataDir.String())
+ }
+
rule.Restat()
zipSyncCleanupCmd(rule, srcJarDir)