Replace hiddenapi-{public,private}-list.txt with a CSV file
`hiddenapi` is being refactored to work with a single CSV file as opposued to a multitude of text files (one per flag). This patch changes the singleton rule for listing public/private APIs from stubs to expect a CSV as an output. Bug: 119068555 Test: compiles, hiddenapi-flags.csv unchanged Change-Id: I622521d59979a6b01ecc8065a278412fedf7b9bc
This commit is contained in:
@@ -983,8 +983,8 @@ func (c *config) EnforceSystemCertificateWhitelist() []string {
|
|||||||
return c.productVariables.EnforceSystemCertificateWhitelist
|
return c.productVariables.EnforceSystemCertificateWhitelist
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) HiddenAPIPublicList() string {
|
func (c *config) HiddenAPIStubFlags() string {
|
||||||
return String(c.productVariables.HiddenAPIPublicList)
|
return String(c.productVariables.HiddenAPIStubFlags)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) HiddenAPIFlags() string {
|
func (c *config) HiddenAPIFlags() string {
|
||||||
|
@@ -273,7 +273,7 @@ type productVariables struct {
|
|||||||
EnforceSystemCertificateWhitelist []string `json:",omitempty"`
|
EnforceSystemCertificateWhitelist []string `json:",omitempty"`
|
||||||
|
|
||||||
// TODO(ccross): move these to a Singleton in Soong
|
// TODO(ccross): move these to a Singleton in Soong
|
||||||
HiddenAPIPublicList *string `json:",omitempty"`
|
HiddenAPIStubFlags *string `json:",omitempty"`
|
||||||
HiddenAPIFlags *string `json:",omitempty"`
|
HiddenAPIFlags *string `json:",omitempty"`
|
||||||
HiddenAPIExtraAppUsageJars []string `json:",omitempty"`
|
HiddenAPIExtraAppUsageJars []string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
@@ -25,24 +25,24 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var hiddenAPIGenerateCSVRule = pctx.AndroidStaticRule("hiddenAPIGenerateCSV", blueprint.RuleParams{
|
var hiddenAPIGenerateCSVRule = pctx.AndroidStaticRule("hiddenAPIGenerateCSV", blueprint.RuleParams{
|
||||||
Command: "${config.Class2Greylist} --public-api-list ${publicAPIList} $in $outFlag $out",
|
Command: "${config.Class2Greylist} --stub-api-flags ${stubAPIFlags} $in $outFlag $out",
|
||||||
CommandDeps: []string{"${config.Class2Greylist}"},
|
CommandDeps: []string{"${config.Class2Greylist}"},
|
||||||
}, "outFlag", "publicAPIList")
|
}, "outFlag", "stubAPIFlags")
|
||||||
|
|
||||||
func hiddenAPIGenerateCSV(ctx android.ModuleContext, classesJar android.Path) {
|
func hiddenAPIGenerateCSV(ctx android.ModuleContext, classesJar android.Path) {
|
||||||
flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
|
flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
|
||||||
metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
|
metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
|
||||||
publicList := &bootImagePath{ctx.Config().HiddenAPIPublicList()}
|
stubFlagsCSV := &bootImagePath{ctx.Config().HiddenAPIStubFlags()}
|
||||||
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: hiddenAPIGenerateCSVRule,
|
Rule: hiddenAPIGenerateCSVRule,
|
||||||
Description: "hiddenapi flags",
|
Description: "hiddenapi flags",
|
||||||
Input: classesJar,
|
Input: classesJar,
|
||||||
Output: flagsCSV,
|
Output: flagsCSV,
|
||||||
Implicit: publicList,
|
Implicit: stubFlagsCSV,
|
||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"outFlag": "--write-flags-csv",
|
"outFlag": "--write-flags-csv",
|
||||||
"publicAPIList": publicList.String(),
|
"stubAPIFlags": stubFlagsCSV.String(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -51,10 +51,10 @@ func hiddenAPIGenerateCSV(ctx android.ModuleContext, classesJar android.Path) {
|
|||||||
Description: "hiddenapi metadata",
|
Description: "hiddenapi metadata",
|
||||||
Input: classesJar,
|
Input: classesJar,
|
||||||
Output: metadataCSV,
|
Output: metadataCSV,
|
||||||
Implicit: publicList,
|
Implicit: stubFlagsCSV,
|
||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"outFlag": "--write-metadata-csv",
|
"outFlag": "--write-metadata-csv",
|
||||||
"publicAPIList": publicList.String(),
|
"stubAPIFlags": stubFlagsCSV.String(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user