Merge changes I07db8afc,Ia89e0239
* changes:
Stop module types being SdkAware
Replace usages of SdkAware in sdk module with Module
diff --git a/android/license.go b/android/license.go
index ab8431a..a09422b 100644
--- a/android/license.go
+++ b/android/license.go
@@ -58,7 +58,6 @@
type licenseModule struct {
ModuleBase
DefaultableModuleBase
- SdkBase
BazelModuleBase
properties licenseProperties
@@ -137,7 +136,6 @@
// The visibility property needs to be checked and parsed by the visibility module.
setPrimaryVisibilityProperty(module, "visibility", &module.properties.Visibility)
- InitSdkAwareModule(module)
initAndroidModuleBase(module)
InitDefaultableModule(module)
InitBazelModule(module)
diff --git a/android/sdk.go b/android/sdk.go
index b94217d..063091e 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -541,7 +541,7 @@
Name() string
// Variants returns all the variants of this module depended upon by the SDK.
- Variants() []SdkAware
+ Variants() []Module
}
// SdkMemberDependencyTag is the interface that a tag must implement in order to allow the
@@ -673,7 +673,7 @@
// The sdk module code generates the snapshot as follows:
//
// * A properties struct of type SdkMemberProperties is created for each variant and
- // populated with information from the variant by calling PopulateFromVariant(SdkAware)
+ // populated with information from the variant by calling PopulateFromVariant(Module)
// on the struct.
//
// * An additional properties struct is created into which the common properties will be
diff --git a/apex/apex.go b/apex/apex.go
index a07576a..b9a3c8f 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -396,7 +396,6 @@
android.ModuleBase
android.DefaultableModuleBase
android.OverridableModuleBase
- android.SdkBase
android.BazelModuleBase
multitree.ExportableModuleBase
@@ -2640,7 +2639,6 @@
android.InitAndroidMultiTargetsArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
android.InitDefaultableModule(module)
- android.InitSdkAwareModule(module)
android.InitOverridableModule(module, &module.overridableProperties.Overrides)
android.InitBazelModule(module)
multitree.InitExportableModule(module)
diff --git a/cc/cc.go b/cc/cc.go
index 35d2d71..cb425c3 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -818,7 +818,6 @@
type Module struct {
fuzz.FuzzModule
- android.SdkBase
android.BazelModuleBase
VendorProperties VendorProperties
@@ -1199,7 +1198,6 @@
android.InitBazelModule(c)
}
android.InitApexModule(c)
- android.InitSdkAwareModule(c)
android.InitDefaultableModule(c)
return c
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index 45af303..af83278 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -293,8 +293,6 @@
android.InitPrebuiltModuleWithSrcSupplier(module, srcsSupplier, srcsProperty)
}
- // Prebuilt libraries can be used in SDKs.
- android.InitSdkAwareModule(module)
return module, library
}
@@ -582,7 +580,6 @@
module.linker = prebuilt
module.AddProperties(&prebuilt.properties)
android.InitPrebuiltModule(module, &prebuilt.properties.Srcs)
- android.InitSdkAwareModule(module)
return module
}
diff --git a/java/base.go b/java/base.go
index 55d77dc..84fda37 100644
--- a/java/base.go
+++ b/java/base.go
@@ -395,7 +395,6 @@
android.ModuleBase
android.DefaultableModuleBase
android.ApexModuleBase
- android.SdkBase
android.BazelModuleBase
// Functionality common to Module and Import.
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index e67f1ca..101d3ca 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -229,7 +229,6 @@
type BootclasspathFragmentModule struct {
android.ModuleBase
android.ApexModuleBase
- android.SdkBase
ClasspathFragmentBase
// True if this fragment is for testing purposes.
@@ -279,7 +278,6 @@
m := &BootclasspathFragmentModule{}
m.AddProperties(&m.properties, &m.sourceOnlyProperties)
android.InitApexModule(m)
- android.InitSdkAwareModule(m)
initClasspathFragment(m, BOOTCLASSPATH)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
@@ -1353,7 +1351,6 @@
// array.
android.InitPrebuiltModule(m, &[]string{"placeholder"})
android.InitApexModule(m)
- android.InitSdkAwareModule(m)
android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibCommon)
// Initialize the contents property from the image_name.
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 2ad2969..066f0d6 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -48,7 +48,6 @@
// Droidstubs
type Droidstubs struct {
Javadoc
- android.SdkBase
properties DroidstubsProperties
apiFile android.Path
@@ -179,7 +178,6 @@
&module.Javadoc.properties)
InitDroiddocModule(module, android.HostAndDeviceSupported)
- android.InitSdkAwareModule(module)
return module
}
@@ -927,7 +925,6 @@
android.ModuleBase
android.DefaultableModuleBase
prebuilt android.Prebuilt
- android.SdkBase
properties PrebuiltStubsSourcesProperties
@@ -1007,7 +1004,6 @@
module.AddProperties(&module.properties)
android.InitPrebuiltModule(module, &module.properties.Srcs)
- android.InitSdkAwareModule(module)
InitDroiddocModule(module, android.HostAndDeviceSupported)
return module
}
diff --git a/java/java.go b/java/java.go
index 927a8d8..3b0ad8d 100644
--- a/java/java.go
+++ b/java/java.go
@@ -876,7 +876,6 @@
module.initModuleAndImport(module)
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
android.InitBazelModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
return module
@@ -899,7 +898,6 @@
module.Module.properties.Installable = proptools.BoolPtr(true)
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
android.InitBazelModule(module)
InitJavaModule(module, android.HostSupported)
return module
@@ -1340,7 +1338,6 @@
module.Module.dexpreopter.isTest = true
module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)
- android.InitSdkAwareModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
return module
}
@@ -1379,7 +1376,6 @@
android.InitPrebuiltModule(module, &module.properties.Jars)
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
return module
}
@@ -1802,7 +1798,6 @@
android.ApexModuleBase
android.BazelModuleBase
prebuilt android.Prebuilt
- android.SdkBase
// Functionality common to Module and Import.
embeddableInModuleAndImport
@@ -2176,7 +2171,6 @@
android.InitPrebuiltModule(module, &module.properties.Jars)
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
android.InitBazelModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
return module
diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go
index 201dede..d417291 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -15,12 +15,11 @@
package java
import (
+ "fmt"
"path/filepath"
"android/soong/android"
"github.com/google/blueprint"
-
- "fmt"
)
func init() {
@@ -55,7 +54,6 @@
type platformCompatConfig struct {
android.ModuleBase
- android.SdkBase
properties platformCompatConfigProperties
installDirPath android.InstallPath
@@ -127,7 +125,6 @@
func PlatformCompatConfigFactory() android.Module {
module := &platformCompatConfig{}
module.AddProperties(&module.properties)
- android.InitSdkAwareModule(module)
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
return module
}
@@ -178,7 +175,6 @@
// A prebuilt version of the platform compat config module.
type prebuiltCompatConfigModule struct {
android.ModuleBase
- android.SdkBase
prebuilt android.Prebuilt
properties prebuiltCompatConfigProperties
@@ -213,7 +209,6 @@
m := &prebuiltCompatConfigModule{}
m.AddProperties(&m.properties)
android.InitSingleSourcePrebuiltModule(m, &m.properties, "Metadata")
- android.InitSdkAwareModule(m)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
return m
}
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 012309d..3b64bf7 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -752,7 +752,7 @@
// commonSdkLibraryAndImportModule defines the interface that must be provided by a module that
// embeds the commonToSdkLibraryAndImport struct.
type commonSdkLibraryAndImportModule interface {
- android.SdkAware
+ android.Module
BaseModuleName() string
}
@@ -2048,7 +2048,6 @@
module.InitSdkLibraryProperties()
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
// Initialize the map from scope to scope specific properties.
@@ -2126,7 +2125,6 @@
android.DefaultableModuleBase
prebuilt android.Prebuilt
android.ApexModuleBase
- android.SdkBase
hiddenAPI
dexpreopter
@@ -2208,7 +2206,6 @@
android.InitPrebuiltModule(module, &[]string{""})
android.InitApexModule(module)
- android.InitSdkAwareModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
module.SetDefaultableHook(func(mctx android.DefaultableHookContext) {
diff --git a/java/system_modules.go b/java/system_modules.go
index fec8eba..0efa1a4 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -114,7 +114,6 @@
module.AddProperties(&module.properties)
android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
android.InitDefaultableModule(module)
- android.InitSdkAwareModule(module)
return module
}
@@ -130,7 +129,6 @@
type SystemModules struct {
android.ModuleBase
android.DefaultableModuleBase
- android.SdkBase
properties SystemModulesProperties
@@ -215,7 +213,6 @@
android.InitPrebuiltModule(module, &module.properties.Libs)
android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
android.InitDefaultableModule(module)
- android.InitSdkAwareModule(module)
return module
}
diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go
index f6cb795..17d301b 100644
--- a/java/systemserver_classpath_fragment.go
+++ b/java/systemserver_classpath_fragment.go
@@ -83,7 +83,6 @@
type SystemServerClasspathModule struct {
android.ModuleBase
android.ApexModuleBase
- android.SdkBase
ClasspathFragmentBase
@@ -113,7 +112,6 @@
m := &SystemServerClasspathModule{}
m.AddProperties(&m.properties)
android.InitApexModule(m)
- android.InitSdkAwareModule(m)
initClasspathFragment(m, SYSTEMSERVERCLASSPATH)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
return m
@@ -331,7 +329,6 @@
// array.
android.InitPrebuiltModule(m, &[]string{"placeholder"})
android.InitApexModule(m)
- android.InitSdkAwareModule(m)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
return m
}
diff --git a/sdk/update.go b/sdk/update.go
index baa2033..f50439c 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -171,9 +171,9 @@
exportedComponentsInfo = ctx.OtherModuleProvider(child, android.ExportedComponentsInfoProvider).(android.ExportedComponentsInfo)
}
- var container android.SdkAware
+ var container android.Module
if parent != ctx.Module() {
- container = parent.(android.SdkAware)
+ container = parent.(android.Module)
}
minApiLevel := android.MinApiLevelForSdkSnapshot(ctx, child)
@@ -182,7 +182,7 @@
s.memberVariantDeps = append(s.memberVariantDeps, sdkMemberVariantDep{
sdkVariant: s,
memberType: memberType,
- variant: child.(android.SdkAware),
+ variant: child.(android.Module),
minApiLevel: minApiLevel,
container: container,
export: export,
@@ -269,7 +269,7 @@
return supportedByTargetBuildRelease
}
-func appendUniqueVariants(variants []android.SdkAware, newVariant android.SdkAware) []android.SdkAware {
+func appendUniqueVariants(variants []android.Module, newVariant android.Module) []android.Module {
for _, v := range variants {
if v == newVariant {
return variants
@@ -1246,12 +1246,12 @@
memberType android.SdkMemberType
// The variant that is added to the sdk.
- variant android.SdkAware
+ variant android.Module
// The optional container of this member, i.e. the module that is depended upon by the sdk
// (possibly transitively) and whose dependency on this module is why it was added to the sdk.
// Is nil if this a direct dependency of the sdk.
- container android.SdkAware
+ container android.Module
// True if the member should be exported, i.e. accessible, from outside the sdk.
export bool
@@ -1270,14 +1270,14 @@
type sdkMember struct {
memberType android.SdkMemberType
name string
- variants []android.SdkAware
+ variants []android.Module
}
func (m *sdkMember) Name() string {
return m.name
}
-func (m *sdkMember) Variants() []android.SdkAware {
+func (m *sdkMember) Variants() []android.Module {
return m.variants
}
@@ -1362,24 +1362,24 @@
// by apex variant, where one is the default/platform variant and one is the APEX variant. In that
// case it picks the APEX variant. It picks the APEX variant because that is the behavior that would
// be expected
-func selectApexVariantsWhereAvailable(ctx *memberContext, variants []android.SdkAware) []android.SdkAware {
+func selectApexVariantsWhereAvailable(ctx *memberContext, variants []android.Module) []android.Module {
moduleCtx := ctx.sdkMemberContext
// Group the variants by coordinates.
- variantsByCoord := make(map[variantCoordinate][]android.SdkAware)
+ variantsByCoord := make(map[variantCoordinate][]android.Module)
for _, variant := range variants {
coord := getVariantCoordinate(ctx, variant)
variantsByCoord[coord] = append(variantsByCoord[coord], variant)
}
- toDiscard := make(map[android.SdkAware]struct{})
+ toDiscard := make(map[android.Module]struct{})
for coord, list := range variantsByCoord {
count := len(list)
if count == 1 {
continue
}
- variantsByApex := make(map[string]android.SdkAware)
+ variantsByApex := make(map[string]android.Module)
conflictDetected := false
for _, variant := range list {
apexInfo := moduleCtx.OtherModuleProvider(variant, android.ApexInfoProvider).(android.ApexInfo)
@@ -1421,7 +1421,7 @@
// If there are any variants to discard then remove them from the list of variants, while
// preserving the order.
if len(toDiscard) > 0 {
- filtered := []android.SdkAware{}
+ filtered := []android.Module{}
for _, variant := range variants {
if _, ok := toDiscard[variant]; !ok {
filtered = append(filtered, variant)