Refactor the hiddenAPI() method for reusability
A follow up change needs to be able to contribute to the information the hiddenapi process collates without having a dex file encoded. This change pushes all the functionality related to information gathering into the hiddenAPIGenerateCSV() method and then renames it and the hiddenAPI() method to make it clearer what they do. Bug: 178361284 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Change-Id: I04417720216a0fbadcd88e6185e7de6570af6216
This commit is contained in:
@@ -76,14 +76,6 @@ func TestHiddenAPISingleton(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func checkRuleInputs(t *testing.T, expected string, hiddenAPIRule android.TestingBuildParams) {
|
||||
actual := strings.TrimSpace(strings.Join(android.NormalizePathsForTesting(hiddenAPIRule.Implicits), "\n"))
|
||||
expected = strings.TrimSpace(expected)
|
||||
if actual != expected {
|
||||
t.Errorf("Expected hiddenapi rule inputs:\n%s\nactual inputs:\n%s", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHiddenAPIIndexSingleton(t *testing.T) {
|
||||
ctx, _ := testHiddenAPIBootJars(t, `
|
||||
java_library {
|
||||
@@ -108,7 +100,7 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
|
||||
|
||||
hiddenAPIIndex := ctx.SingletonForTests("hiddenapi_index")
|
||||
indexRule := hiddenAPIIndex.Rule("singleton-merged-hiddenapi-index")
|
||||
checkRuleInputs(t, `
|
||||
CheckHiddenAPIRuleInputs(t, `
|
||||
.intermediates/bar/android_common/hiddenapi/index.csv
|
||||
.intermediates/foo/android_common/hiddenapi/index.csv
|
||||
`,
|
||||
|
Reference in New Issue
Block a user