Generate java_api_library from java_sdk_library
This change enables java_sdk_library to generate java_api_library modules per api surface, so that from-text stubs can be generated per api domain scope. This module is only created when `--build-from-text-stub` flag is passed during build. Ignore-AOSP-First: config.apiLibraries list differ between AOSP and internal master Test: enable disabled modules in java/core-libraries/TxtStubLibraries.bp then m art.module.public.api.stubs.from-text --build-from-text-stub Bug: 276957733 Change-Id: Ic1ead15b3d0bcb921ca8d31bcaeeb4cd9ee8715c
This commit is contained in:
@@ -302,6 +302,9 @@ type config struct {
|
||||
// modules that aren't mixed-built for at least one variant will cause a build
|
||||
// failure
|
||||
ensureAllowlistIntegrity bool
|
||||
|
||||
// List of Api libraries that contribute to Api surfaces.
|
||||
apiLibraries map[string]struct{}
|
||||
}
|
||||
|
||||
type deviceConfig struct {
|
||||
@@ -622,6 +625,36 @@ func NewConfig(cmdArgs CmdArgs, availableEnv map[string]string) (Config, error)
|
||||
config.BazelContext, err = NewBazelContext(config)
|
||||
config.Bp2buildPackageConfig = GetBp2BuildAllowList()
|
||||
|
||||
// TODO(b/276958307): Replace the hardcoded list to a sdk_library local prop.
|
||||
config.apiLibraries = map[string]struct{}{
|
||||
"android.net.ipsec.ike": {},
|
||||
"art.module.public.api": {},
|
||||
"conscrypt.module.public.api": {},
|
||||
"framework-adservices": {},
|
||||
"framework-appsearch": {},
|
||||
"framework-bluetooth": {},
|
||||
"framework-configinfrastructure": {},
|
||||
"framework-connectivity": {},
|
||||
"framework-connectivity-t": {},
|
||||
"framework-devicelock": {},
|
||||
"framework-graphics": {},
|
||||
"framework-healthfitness": {},
|
||||
"framework-media": {},
|
||||
"framework-mediaprovider": {},
|
||||
"framework-ondevicepersonalization": {},
|
||||
"framework-permission": {},
|
||||
"framework-permission-s": {},
|
||||
"framework-scheduling": {},
|
||||
"framework-sdkextensions": {},
|
||||
"framework-statsd": {},
|
||||
"framework-sdksandbox": {},
|
||||
"framework-tethering": {},
|
||||
"framework-uwb": {},
|
||||
"framework-virtualization": {},
|
||||
"framework-wifi": {},
|
||||
"i18n.module.public.api": {},
|
||||
}
|
||||
|
||||
return Config{config}, err
|
||||
}
|
||||
|
||||
@@ -1983,8 +2016,20 @@ func (c *config) BuildFromTextStub() bool {
|
||||
func (c *config) SetBuildFromTextStub(b bool) {
|
||||
c.buildFromTextStub = b
|
||||
}
|
||||
|
||||
func (c *config) AddForceEnabledModules(forceEnabled []string) {
|
||||
for _, forceEnabledModule := range forceEnabled {
|
||||
c.bazelForceEnabledModules[forceEnabledModule] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *config) SetApiLibraries(libs []string) {
|
||||
c.apiLibraries = make(map[string]struct{})
|
||||
for _, lib := range libs {
|
||||
c.apiLibraries[lib] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *config) GetApiLibraries() map[string]struct{} {
|
||||
return c.apiLibraries
|
||||
}
|
||||
|
Reference in New Issue
Block a user