Support mechanism to select a specific version of module sdk prebuilt
This CL is the platform_compat_config equivalent of aosp/2928483. {prebuilt_}_platform_compat_config are collated by `global_compat_config` via a singleton. The collated data is then used in some CTS tests. At ToT, we ensure that the collation ignores the platform_compat_config of prebuilt when source is selected, and vice versa. With trunk stable, multiple versions of prebuilt apexes and prebuilt platform compat configs might exist in the tree. This CL uses `Source_module_name` to hide the platform compat configs of the unselected prebuilt apexes. Bug: 322175508 Test: Added a unit test Change-Id: Iafdde8fc0458b37b3ccde25433070936f144915c
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
"android/soong/android"
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/proptools"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -184,6 +185,11 @@ type prebuiltCompatConfigModule struct {
|
||||
|
||||
type prebuiltCompatConfigProperties struct {
|
||||
Metadata *string `android:"path"`
|
||||
|
||||
// Name of the source soong module that gets shadowed by this prebuilt
|
||||
// If unspecified, follows the naming convention that the source module of
|
||||
// the prebuilt is Name() without "prebuilt_" prefix
|
||||
Source_module_name *string
|
||||
}
|
||||
|
||||
func (module *prebuiltCompatConfigModule) Prebuilt() *android.Prebuilt {
|
||||
@@ -198,6 +204,10 @@ func (module *prebuiltCompatConfigModule) compatConfigMetadata() android.Path {
|
||||
return module.metadataFile
|
||||
}
|
||||
|
||||
func (module *prebuiltCompatConfigModule) BaseModuleName() string {
|
||||
return proptools.StringDefault(module.properties.Source_module_name, module.ModuleBase.Name())
|
||||
}
|
||||
|
||||
var _ platformCompatConfigMetadataProvider = (*prebuiltCompatConfigModule)(nil)
|
||||
|
||||
func (module *prebuiltCompatConfigModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
Reference in New Issue
Block a user