Correct module_lib scope name
The module_lib scope should be called module-lib in order to pick up
the latest filegroup. Without it the API lint does not use a baseline
and so reports issues with released and unchangeable APIs.
It is also needed for the correct dist path.
Test: m update-api
Bug: 155164730
Change-Id: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 3e7bc72..7e81c1e 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -92,6 +92,9 @@
// The name of the field in the dynamically created structure.
fieldName string
+ // The name of the property in the java_sdk_library_import
+ propertyName string
+
// The tag to use to depend on the stubs library module.
stubsTag scopeDependencyTag
@@ -142,7 +145,8 @@
// Initialize a scope, creating and adding appropriate dependency tags
func initApiScope(scope *apiScope) *apiScope {
name := scope.name
- scope.fieldName = proptools.FieldNameForProperty(name)
+ scope.propertyName = strings.ReplaceAll(name, "-", "_")
+ scope.fieldName = proptools.FieldNameForProperty(scope.propertyName)
scope.stubsTag = scopeDependencyTag{
name: name + "-stubs",
apiScope: scope,
@@ -253,7 +257,7 @@
unstable: true,
})
apiScopeModuleLib = initApiScope(&apiScope{
- name: "module_lib",
+ name: "module-lib",
extends: apiScopeSystem,
// Module_lib scope is disabled by default in legacy mode.
//
@@ -1710,7 +1714,7 @@
for _, apiScope := range allApiScopes {
if properties, ok := s.Scopes[apiScope]; ok {
- scopeSet := propertySet.AddPropertySet(apiScope.name)
+ scopeSet := propertySet.AddPropertySet(apiScope.propertyName)
scopeDir := filepath.Join("sdk_library", s.OsPrefix(), apiScope.name)