Merge changes from topics "remove_api_files", "remove_naming_convention" into main

* changes:
  Remove naming conventioned based file sorting in java_api_library
  Remove api_files property from java_api_library
This commit is contained in:
Jihoon Kang
2023-09-25 22:31:53 +00:00
committed by Gerrit Code Review
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