Add --proguard option to metalava

Also clean-up properties comments

Test: m -j docs
Bug: b/78245848
Change-Id: I43899e9841e0d29e5be7ab2b393cc78186970231
This commit is contained in:
Nan Zhang 2018-09-19 12:40:06 -07:00
parent 5994b620f2
commit 199645cd76

View file

@ -307,31 +307,34 @@ type DroidstubsProperties struct {
// the tag name used to distinguish if the API files belong to public/system/test.
Api_tag_name *string
// the generated public API filename by Doclava.
// the generated public API filename by Metalava.
Api_filename *string
// the generated public Dex API filename by Doclava.
// the generated public Dex API filename by Metalava.
Dex_api_filename *string
// the generated private API filename by Doclava.
// the generated private API filename by Metalava.
Private_api_filename *string
// the generated private Dex API filename by Doclava.
// the generated private Dex API filename by Metalava.
Private_dex_api_filename *string
// the generated removed API filename by Doclava.
// the generated removed API filename by Metalava.
Removed_api_filename *string
// the generated removed Dex API filename by Doclava.
// the generated removed Dex API filename by Metalava.
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.
// the generated exact API filename by Metalava.
Exact_api_filename *string
// the generated proguard filename by Metalava.
Proguard_filename *string
Check_api struct {
Last_released ApiToCheck
@ -1213,6 +1216,7 @@ type Droidstubs struct {
removedDexApiFile android.WritablePath
apiMappingFile android.WritablePath
exactApiFile android.WritablePath
proguardFile android.WritablePath
checkCurrentApiTimestamp android.WritablePath
updateCurrentApiTimestamp android.WritablePath
@ -1363,6 +1367,12 @@ func (d *Droidstubs) collectStubsFlags(ctx android.ModuleContext,
*implicitOutputs = append(*implicitOutputs, d.apiMappingFile)
}
if String(d.properties.Proguard_filename) != "" {
d.proguardFile = android.PathForModuleOut(ctx, String(d.properties.Proguard_filename))
metalavaFlags += " --proguard " + d.proguardFile.String()
*implicitOutputs = append(*implicitOutputs, d.proguardFile)
}
if Bool(d.properties.Write_sdk_values) {
metalavaFlags = metalavaFlags + " --sdk-values " + android.PathForModuleOut(ctx, "out").String()
}