When adding new libraries, java currently have these hardcoded known group ids other than com.google.cloud:
|
switch { |
|
case strings.HasPrefix(apiPath, "google/shopping/"): |
|
return setNonCloudMavenDefaults(lib, "com.google.shopping") |
|
case strings.HasPrefix(apiPath, "google/maps/"): |
|
return setNonCloudMavenDefaults(lib, "com.google.maps") |
|
case strings.HasPrefix(apiPath, "google/ads/"): |
|
return setNonCloudMavenDefaults(lib, "com.google.api-ads") |
|
} |
We should convert these into config in the defaults for java:
|
Java *JavaDefault `yaml:"java,omitempty"` |
Preserve the mapping from API path to relevant group id.
This approach has benefits that:
- Supported group ids are visible from config
- When adding new group ids in the future, this is configurable and no changes to librarian needed
When adding new libraries, java currently have these hardcoded known group ids other than com.google.cloud:
librarian/internal/librarian/java/add.go
Lines 55 to 62 in 24b170e
We should convert these into config in the defaults for java:
librarian/internal/config/config.go
Line 221 in 24b170e
Preserve the mapping from API path to relevant group id.
This approach has benefits that: