Extract IsModuleInVersionedSdk
Bug: 177892522 Test: m nothing Change-Id: I348d380a0d29abdd6a84420be52cc1b674f2a7ab
This commit is contained in:
@@ -171,6 +171,16 @@ func InitSdkAwareModule(m SdkAware) {
|
|||||||
m.AddProperties(&base.properties)
|
m.AddProperties(&base.properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsModuleInVersionedSdk returns true if the module is an versioned sdk.
|
||||||
|
func IsModuleInVersionedSdk(module Module) bool {
|
||||||
|
if s, ok := module.(SdkAware); ok {
|
||||||
|
if !s.ContainingSdk().Unversioned() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Provide support for generating the build rules which will build the snapshot.
|
// Provide support for generating the build rules which will build the snapshot.
|
||||||
type SnapshotBuilder interface {
|
type SnapshotBuilder interface {
|
||||||
// Copy src to the dest (which is a snapshot relative path) and add the dest
|
// Copy src to the dest (which is a snapshot relative path) and add the dest
|
||||||
|
@@ -150,7 +150,7 @@ func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext,
|
|||||||
imageName := proptools.String(m.properties.Image_name)
|
imageName := proptools.String(m.properties.Image_name)
|
||||||
if imageName == "art" {
|
if imageName == "art" {
|
||||||
// TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
|
// TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
|
||||||
if m.MemberName() != "" {
|
if android.IsModuleInVersionedSdk(m) {
|
||||||
// The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
|
// The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
|
||||||
// 1. There is no way to use this at the moment so ignoring it is safe.
|
// 1. There is no way to use this at the moment so ignoring it is safe.
|
||||||
// 2. Attempting to initialize the contents property from the configuration will end up having
|
// 2. Attempting to initialize the contents property from the configuration will end up having
|
||||||
@@ -205,7 +205,7 @@ func (b *BootclasspathFragmentModule) bootclasspathImageNameContentsConsistencyC
|
|||||||
imageName := proptools.String(b.properties.Image_name)
|
imageName := proptools.String(b.properties.Image_name)
|
||||||
if imageName == "art" {
|
if imageName == "art" {
|
||||||
// TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
|
// TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
|
||||||
if b.MemberName() != "" {
|
if android.IsModuleInVersionedSdk(b) {
|
||||||
// The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
|
// The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
|
||||||
// 1. There is no way to use this at the moment so ignoring it is safe.
|
// 1. There is no way to use this at the moment so ignoring it is safe.
|
||||||
// 2. Attempting to initialize the contents property from the configuration will end up having
|
// 2. Attempting to initialize the contents property from the configuration will end up having
|
||||||
|
@@ -226,10 +226,8 @@ type platformCompatConfigSingleton struct {
|
|||||||
func isModulePreferredByCompatConfig(module android.Module) bool {
|
func isModulePreferredByCompatConfig(module android.Module) bool {
|
||||||
// A versioned prebuilt_platform_compat_config, i.e. foo-platform-compat-config@current should be
|
// A versioned prebuilt_platform_compat_config, i.e. foo-platform-compat-config@current should be
|
||||||
// ignored.
|
// ignored.
|
||||||
if s, ok := module.(android.SdkAware); ok {
|
if android.IsModuleInVersionedSdk(module) {
|
||||||
if !s.ContainingSdk().Unversioned() {
|
return false
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return android.IsModulePreferred(module)
|
return android.IsModulePreferred(module)
|
||||||
|
Reference in New Issue
Block a user