aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2018-06-22 15:28:11 +0100
committerMathew Inwood <mathewi@google.com>2018-07-10 05:48:49 +0000
commit76c3de1ceaefee3a3a167e790e76fa89d60dd32e (patch)
treee8da853d434f61aff5c8e7909cd1fce11731b0e9
parentbdf16ec5b246952a81c9ed740dae894a534bb9de (diff)
downloadbuild_soong-76c3de1ceaefee3a3a167e790e76fa89d60dd32e.tar.gz
build_soong-76c3de1ceaefee3a3a167e790e76fa89d60dd32e.tar.bz2
build_soong-76c3de1ceaefee3a3a167e790e76fa89d60dd32e.zip
Add support for -apiMapping parameter in DocLava.
This is used to output a mapping of class member signature to source position, which in turn is used for automated addition of annotations in frameworks code. Metalava support does not exist (yet), and may not be needed, since the addition of these annotations in a one-time thing. This change can be reverted once this is complete. See go/hidden-api-annotations for more context. Test: m Bug: 110868826 Change-Id: I90e409f6ea02b16eb9e03d92382f9bb46a8fdab5
-rw-r--r--java/droiddoc.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go
index dbceed86..6cb8d3c1 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -226,6 +226,10 @@ type DroiddocProperties struct {
// the generated removed Dex API filename by Doclava.
Removed_dex_api_filename *string
+ // mapping of dex signatures to source file and line number. This is a temporary property and
+ // will be deleted; you probably shouldn't be using it.
+ Dex_mapping_filename *string
+
// the generated exact API filename by Doclava.
Exact_api_filename *string
@@ -283,6 +287,7 @@ type Droiddoc struct {
removedApiFile android.WritablePath
removedDexApiFile android.WritablePath
exactApiFile android.WritablePath
+ apiMappingFile android.WritablePath
checkCurrentApiTimestamp android.WritablePath
updateCurrentApiTimestamp android.WritablePath
@@ -831,6 +836,13 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
implicitOutputs = append(implicitOutputs, d.exactApiFile)
}
+ if String(d.properties.Dex_mapping_filename) != "" {
+ d.apiMappingFile = android.PathForModuleOut(ctx, String(d.properties.Dex_mapping_filename))
+ args = args + " -apiMapping " + d.apiMappingFile.String()
+ // Omitted: metalava support
+ implicitOutputs = append(implicitOutputs, d.apiMappingFile)
+ }
+
implicits = append(implicits, d.Javadoc.srcJars...)
implicitOutputs = append(implicitOutputs, d.Javadoc.docZip)