From fbe4cc32edbfc40a629a96d63e0b862299ebd75a Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Thu, 31 May 2018 13:56:46 +0100 Subject: [PATCH] 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 --- java/androidmk.go | 3 +++ java/droiddoc.go | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/java/androidmk.go b/java/androidmk.go index 084019856..ab9ceeb99 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -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()) } diff --git a/java/droiddoc.go b/java/droiddoc.go index b6410417b..ca99e76f3 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -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()