Merge "apex: Make android_library support APEX variants" into rvc-dev
This commit is contained in:
55
apex/apex.go
55
apex/apex.go
@@ -244,7 +244,14 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
// Module separator
|
// Module separator
|
||||||
//
|
//
|
||||||
m["com.android.extservices"] = []string{
|
m["com.android.extservices"] = []string{
|
||||||
|
"error_prone_annotations",
|
||||||
|
"ExtServices-core",
|
||||||
|
"ExtServices",
|
||||||
|
"libtextclassifier-java",
|
||||||
"libz_current",
|
"libz_current",
|
||||||
|
"textclassifier-statsd",
|
||||||
|
"TextClassifierNotificationLibNoManifest",
|
||||||
|
"TextClassifierServiceLibNoManifest",
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Module separator
|
// Module separator
|
||||||
@@ -292,7 +299,10 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
"android.hidl.token@1.0",
|
"android.hidl.token@1.0",
|
||||||
"android.hidl.token@1.0-utils",
|
"android.hidl.token@1.0-utils",
|
||||||
"bionic_libc_platform_headers",
|
"bionic_libc_platform_headers",
|
||||||
|
"exoplayer2-extractor",
|
||||||
|
"exoplayer2-extractor-annotation-stubs",
|
||||||
"gl_headers",
|
"gl_headers",
|
||||||
|
"jsr305",
|
||||||
"libEGL",
|
"libEGL",
|
||||||
"libEGL_blobCache",
|
"libEGL_blobCache",
|
||||||
"libEGL_getProcAddress",
|
"libEGL_getProcAddress",
|
||||||
@@ -549,12 +559,8 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
// Module separator
|
// Module separator
|
||||||
//
|
//
|
||||||
m["com.android.permission"] = []string{
|
m["com.android.permission"] = []string{
|
||||||
"androidx.annotation_annotation",
|
"car-ui-lib",
|
||||||
"androidx.annotation_annotation-nodeps",
|
"iconloader",
|
||||||
"androidx.lifecycle_lifecycle-common",
|
|
||||||
"androidx.lifecycle_lifecycle-common-java8",
|
|
||||||
"androidx.lifecycle_lifecycle-common-java8-nodeps",
|
|
||||||
"androidx.lifecycle_lifecycle-common-nodeps",
|
|
||||||
"kotlin-annotations",
|
"kotlin-annotations",
|
||||||
"kotlin-stdlib",
|
"kotlin-stdlib",
|
||||||
"kotlin-stdlib-jdk7",
|
"kotlin-stdlib-jdk7",
|
||||||
@@ -566,6 +572,15 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
"permissioncontroller-statsd",
|
"permissioncontroller-statsd",
|
||||||
"GooglePermissionController",
|
"GooglePermissionController",
|
||||||
"PermissionController",
|
"PermissionController",
|
||||||
|
"SettingsLibActionBarShadow",
|
||||||
|
"SettingsLibAppPreference",
|
||||||
|
"SettingsLibBarChartPreference",
|
||||||
|
"SettingsLibLayoutPreference",
|
||||||
|
"SettingsLibProgressBar",
|
||||||
|
"SettingsLibSearchWidget",
|
||||||
|
"SettingsLibSettingsTheme",
|
||||||
|
"SettingsLibRestrictedLockUtils",
|
||||||
|
"SettingsLibHelpUtils",
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Module separator
|
// Module separator
|
||||||
@@ -627,13 +642,21 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
// Module separator
|
// Module separator
|
||||||
//
|
//
|
||||||
m["com.android.tethering"] = []string{
|
m["com.android.tethering"] = []string{
|
||||||
"libnativehelper_compat_libc++",
|
"android.hardware.tetheroffload.config-V1.0-java",
|
||||||
"android.hardware.tetheroffload.config@1.0",
|
"android.hardware.tetheroffload.control-V1.0-java",
|
||||||
|
"android.hidl.base-V1.0-java",
|
||||||
|
"ipmemorystore-aidl-interfaces-java",
|
||||||
"libcgrouprc",
|
"libcgrouprc",
|
||||||
"libcgrouprc_format",
|
"libcgrouprc_format",
|
||||||
|
"libnativehelper_compat_libc++",
|
||||||
"libtetherutilsjni",
|
"libtetherutilsjni",
|
||||||
"libvndksupport",
|
"libvndksupport",
|
||||||
|
"net-utils-framework-common",
|
||||||
|
"netd_aidl_interface-V3-java",
|
||||||
|
"netlink-client",
|
||||||
|
"networkstack-aidl-interfaces-java",
|
||||||
"tethering-aidl-interfaces-java",
|
"tethering-aidl-interfaces-java",
|
||||||
|
"TetheringApiCurrentLib",
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Module separator
|
// Module separator
|
||||||
@@ -657,8 +680,6 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
"android.hidl.manager-V1.0-java",
|
"android.hidl.manager-V1.0-java",
|
||||||
"android.hidl.manager-V1.1-java",
|
"android.hidl.manager-V1.1-java",
|
||||||
"android.hidl.manager-V1.2-java",
|
"android.hidl.manager-V1.2-java",
|
||||||
"androidx.annotation_annotation",
|
|
||||||
"androidx.annotation_annotation-nodeps",
|
|
||||||
"bouncycastle-unbundled",
|
"bouncycastle-unbundled",
|
||||||
"dnsresolver_aidl_interface-V2-java",
|
"dnsresolver_aidl_interface-V2-java",
|
||||||
"error_prone_annotations",
|
"error_prone_annotations",
|
||||||
@@ -680,7 +701,6 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
"wifi-nano-protos",
|
"wifi-nano-protos",
|
||||||
"wifi-service-pre-jarjar",
|
"wifi-service-pre-jarjar",
|
||||||
"wifi-service-resources",
|
"wifi-service-resources",
|
||||||
"prebuilt_androidx.annotation_annotation-nodeps",
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Module separator
|
// Module separator
|
||||||
@@ -700,6 +720,15 @@ func makeApexAvailableWhitelist() map[string][]string {
|
|||||||
// Module separator
|
// Module separator
|
||||||
//
|
//
|
||||||
m[android.AvailableToAnyApex] = []string{
|
m[android.AvailableToAnyApex] = []string{
|
||||||
|
// TODO(b/156996905) Set apex_available/min_sdk_version for androidx/extras support libraries
|
||||||
|
"androidx",
|
||||||
|
"androidx-constraintlayout_constraintlayout",
|
||||||
|
"androidx-constraintlayout_constraintlayout-nodeps",
|
||||||
|
"androidx-constraintlayout_constraintlayout-solver",
|
||||||
|
"androidx-constraintlayout_constraintlayout-solver-nodeps",
|
||||||
|
"com.google.android.material_material",
|
||||||
|
"com.google.android.material_material-nodeps",
|
||||||
|
|
||||||
"libatomic",
|
"libatomic",
|
||||||
"libclang_rt",
|
"libclang_rt",
|
||||||
"libgcc_stripped",
|
"libgcc_stripped",
|
||||||
@@ -2240,6 +2269,10 @@ func normalizeModuleName(moduleName string) string {
|
|||||||
// We don't want to list them all
|
// We don't want to list them all
|
||||||
moduleName = "libclang_rt"
|
moduleName = "libclang_rt"
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(moduleName, "androidx.") {
|
||||||
|
// TODO(b/156996905) Set apex_available/min_sdk_version for androidx support libraries
|
||||||
|
moduleName = "androidx"
|
||||||
|
}
|
||||||
return moduleName
|
return moduleName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
java/aar.go
10
java/aar.go
@@ -513,6 +513,7 @@ func AndroidLibraryFactory() android.Module {
|
|||||||
|
|
||||||
module.androidLibraryProperties.BuildAAR = true
|
module.androidLibraryProperties.BuildAAR = true
|
||||||
|
|
||||||
|
android.InitApexModule(module)
|
||||||
InitJavaModule(module, android.DeviceSupported)
|
InitJavaModule(module, android.DeviceSupported)
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
@@ -537,8 +538,12 @@ type AARImportProperties struct {
|
|||||||
type AARImport struct {
|
type AARImport struct {
|
||||||
android.ModuleBase
|
android.ModuleBase
|
||||||
android.DefaultableModuleBase
|
android.DefaultableModuleBase
|
||||||
|
android.ApexModuleBase
|
||||||
prebuilt android.Prebuilt
|
prebuilt android.Prebuilt
|
||||||
|
|
||||||
|
// Functionality common to Module and Import.
|
||||||
|
embeddableInModuleAndImport
|
||||||
|
|
||||||
properties AARImportProperties
|
properties AARImportProperties
|
||||||
|
|
||||||
classpathFile android.WritablePath
|
classpathFile android.WritablePath
|
||||||
@@ -742,6 +747,10 @@ func (a *AARImport) SrcJarArgs() ([]string, android.Paths) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AARImport) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
|
||||||
|
return a.depIsInSameApex(ctx, dep)
|
||||||
|
}
|
||||||
|
|
||||||
var _ android.PrebuiltInterface = (*Import)(nil)
|
var _ android.PrebuiltInterface = (*Import)(nil)
|
||||||
|
|
||||||
// android_library_import imports an `.aar` file into the build graph as if it was built with android_library.
|
// android_library_import imports an `.aar` file into the build graph as if it was built with android_library.
|
||||||
@@ -754,6 +763,7 @@ func AARImportFactory() android.Module {
|
|||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
|
||||||
android.InitPrebuiltModule(module, &module.properties.Aars)
|
android.InitPrebuiltModule(module, &module.properties.Aars)
|
||||||
|
android.InitApexModule(module)
|
||||||
InitJavaModule(module, android.DeviceSupported)
|
InitJavaModule(module, android.DeviceSupported)
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
@@ -211,6 +211,11 @@ func (prebuilt *DexImport) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (prebuilt *AARImport) AndroidMkEntries() []android.AndroidMkEntries {
|
func (prebuilt *AARImport) AndroidMkEntries() []android.AndroidMkEntries {
|
||||||
|
if !prebuilt.IsForPlatform() {
|
||||||
|
return []android.AndroidMkEntries{{
|
||||||
|
Disabled: true,
|
||||||
|
}}
|
||||||
|
}
|
||||||
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
||||||
Class: "JAVA_LIBRARIES",
|
Class: "JAVA_LIBRARIES",
|
||||||
OutputFile: android.OptionalPathForPath(prebuilt.classpathFile),
|
OutputFile: android.OptionalPathForPath(prebuilt.classpathFile),
|
||||||
@@ -416,6 +421,11 @@ func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
||||||
|
if !a.IsForPlatform() {
|
||||||
|
return []android.AndroidMkEntries{{
|
||||||
|
Disabled: true,
|
||||||
|
}}
|
||||||
|
}
|
||||||
entriesList := a.Library.AndroidMkEntries()
|
entriesList := a.Library.AndroidMkEntries()
|
||||||
entries := &entriesList[0]
|
entries := &entriesList[0]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user