Support new Doclava flag

CL I5f92a54d718749f8ddef9472f3b6387a3debd385 adds a new "-dexApi" flag
to Doclava, which generates the public API as a list of Dex signatures.
Add support for this flag to Soong and expose it in the droiddoc rule.

Bug: 80461842
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: Iadf09f17bb783209a6555ce5289c381bf025a01c
This commit is contained in:
David Brazdil 2018-05-31 13:56:46 +01:00
parent 8d29e1e024
commit fbe4cc32ed
2 changed files with 13 additions and 0 deletions

View File

@ -333,6 +333,9 @@ func (ddoc *Droiddoc) AndroidMk() android.AndroidMkData {
if ddoc.apiFile != nil {
fmt.Fprintln(w, apiFilePrefix+"API_FILE := ", ddoc.apiFile.String())
}
if ddoc.dexApiFile != nil {
fmt.Fprintln(w, apiFilePrefix+"DEX_API_FILE := ", ddoc.dexApiFile.String())
}
if ddoc.privateApiFile != nil {
fmt.Fprintln(w, apiFilePrefix+"PRIVATE_API_FILE := ", ddoc.privateApiFile.String())
}

View File

@ -203,6 +203,9 @@ type DroiddocProperties struct {
// the generated public API filename by Doclava.
Api_filename *string
// the generated public Dex API filename by Doclava.
Dex_api_filename *string
// the generated private API filename by Doclava.
Private_api_filename *string
@ -266,6 +269,7 @@ type Droiddoc struct {
properties DroiddocProperties
apiFile android.WritablePath
dexApiFile android.WritablePath
privateApiFile android.WritablePath
privateDexApiFile android.WritablePath
removedApiFile android.WritablePath
@ -753,6 +757,12 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
implicitOutputs = append(implicitOutputs, d.privateApiFile)
}
if String(d.properties.Dex_api_filename) != "" {
d.dexApiFile = android.PathForModuleOut(ctx, String(d.properties.Dex_api_filename))
args = args + " -dexApi " + d.dexApiFile.String()
implicitOutputs = append(implicitOutputs, d.dexApiFile)
}
if String(d.properties.Private_dex_api_filename) != "" {
d.privateDexApiFile = android.PathForModuleOut(ctx, String(d.properties.Private_dex_api_filename))
args = args + " -privateDexApi " + d.privateDexApiFile.String()