Merge changes from topics "remove_api_files", "remove_naming_convention" into main am: 534e2e504d am: 426d016353 am: 1eaf6404ab am: 3f2880d220 am: 6c54015e4a

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2758365

Change-Id: I5b63aad96dad5f7a2927babd7238f7ffded8b1c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jihoon Kang
2023-09-26 03:14:52 +00:00
committed by Automerger Merge Worker
4 changed files with 124 additions and 85 deletions

View File

@@ -286,6 +286,17 @@ func (scopes apiScopes) Strings(accessor func(*apiScope) string) []string {
return list
}
// Method that maps the apiScopes properties to the index of each apiScopes elements.
// apiScopes property to be used as the key can be specified with the input accessor.
// Only a string property of apiScope can be used as the key of the map.
func (scopes apiScopes) MapToIndex(accessor func(*apiScope) string) map[string]int {
ret := make(map[string]int)
for i, scope := range scopes {
ret[accessor(scope)] = i
}
return ret
}
var (
scopeByName = make(map[string]*apiScope)
allScopeNames []string