Merge "apex: Make android_library support APEX variants"
This commit is contained in:
10
java/aar.go
10
java/aar.go
@@ -516,6 +516,7 @@ func AndroidLibraryFactory() android.Module {
|
||||
|
||||
module.androidLibraryProperties.BuildAAR = true
|
||||
|
||||
android.InitApexModule(module)
|
||||
InitJavaModule(module, android.DeviceSupported)
|
||||
return module
|
||||
}
|
||||
@@ -540,8 +541,12 @@ type AARImportProperties struct {
|
||||
type AARImport struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
android.ApexModuleBase
|
||||
prebuilt android.Prebuilt
|
||||
|
||||
// Functionality common to Module and Import.
|
||||
embeddableInModuleAndImport
|
||||
|
||||
properties AARImportProperties
|
||||
|
||||
classpathFile android.WritablePath
|
||||
@@ -745,6 +750,10 @@ func (a *AARImport) SrcJarArgs() ([]string, android.Paths) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (a *AARImport) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
|
||||
return a.depIsInSameApex(ctx, dep)
|
||||
}
|
||||
|
||||
var _ android.PrebuiltInterface = (*Import)(nil)
|
||||
|
||||
// android_library_import imports an `.aar` file into the build graph as if it was built with android_library.
|
||||
@@ -757,6 +766,7 @@ func AARImportFactory() android.Module {
|
||||
module.AddProperties(&module.properties)
|
||||
|
||||
android.InitPrebuiltModule(module, &module.properties.Aars)
|
||||
android.InitApexModule(module)
|
||||
InitJavaModule(module, android.DeviceSupported)
|
||||
return module
|
||||
}
|
||||
|
@@ -211,6 +211,11 @@ func (prebuilt *DexImport) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
}
|
||||
|
||||
func (prebuilt *AARImport) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
if !prebuilt.IsForPlatform() {
|
||||
return []android.AndroidMkEntries{{
|
||||
Disabled: true,
|
||||
}}
|
||||
}
|
||||
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
||||
Class: "JAVA_LIBRARIES",
|
||||
OutputFile: android.OptionalPathForPath(prebuilt.classpathFile),
|
||||
@@ -416,6 +421,11 @@ func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
}
|
||||
|
||||
func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
if !a.IsForPlatform() {
|
||||
return []android.AndroidMkEntries{{
|
||||
Disabled: true,
|
||||
}}
|
||||
}
|
||||
entriesList := a.Library.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
|
||||
|
Reference in New Issue
Block a user