diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go index c6f6a3455..fb2ddf917 100644 --- a/java/java.go +++ b/java/java.go @@ -268,6 +268,7 @@ func (me *CompilerDeviceProperties) EffectiveOptimizeEnabled() bool { type Module struct { android.ModuleBase android.DefaultableModuleBase + android.ApexModuleBase properties CompilerProperties protoProperties android.ProtoProperties @@ -1568,7 +1569,8 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.deviceProperties.UncompressDex = j.dexpreopter.uncompressedDex j.compile(ctx, nil) - if (Bool(j.properties.Installable) || ctx.Host()) && !android.DirectlyInAnyApex(ctx, ctx.ModuleName()) { + exclusivelyForApex := android.InAnyApex(ctx.ModuleName()) && !j.IsForPlatform() + if (Bool(j.properties.Installable) || ctx.Host()) && !exclusivelyForApex { j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile) } @@ -1599,6 +1601,7 @@ func LibraryFactory() android.Module { &module.Module.protoProperties) InitJavaModule(module, android.HostAndDeviceSupported) + android.InitApexModule(module) return module } @@ -1621,6 +1624,7 @@ func LibraryHostFactory() android.Module { module.Module.properties.Installable = proptools.BoolPtr(true) InitJavaModule(module, android.HostSupported) + android.InitApexModule(module) return module } @@ -1876,6 +1880,7 @@ type ImportProperties struct { type Import struct { android.ModuleBase android.DefaultableModuleBase + android.ApexModuleBase prebuilt android.Prebuilt properties ImportProperties @@ -2032,6 +2037,7 @@ func ImportFactory() android.Module { android.InitPrebuiltModule(module, &module.properties.Jars) InitJavaModule(module, android.HostAndDeviceSupported) + android.InitApexModule(module) return module } @@ -2047,6 +2053,7 @@ func ImportFactoryHost() android.Module { android.InitPrebuiltModule(module, &module.properties.Jars) InitJavaModule(module, android.HostSupported) + android.InitApexModule(module) return module } @@ -2059,6 +2066,7 @@ type DexImportProperties struct { type DexImport struct { android.ModuleBase android.DefaultableModuleBase + android.ApexModuleBase prebuilt android.Prebuilt properties DexImportProperties @@ -2150,6 +2158,7 @@ func DexImportFactory() android.Module { android.InitPrebuiltModule(module, &module.properties.Jars) InitJavaModule(module, android.DeviceSupported) + android.InitApexModule(module) return module } @@ -2159,6 +2168,7 @@ func DexImportFactory() android.Module { type Defaults struct { android.ModuleBase android.DefaultsModuleBase + android.ApexModuleBase } // java_defaults provides a set of properties that can be inherited by other java or android modules. @@ -2217,7 +2227,7 @@ func DefaultsFactory(props ...interface{}) android.Module { ) android.InitDefaultsModule(module) - + android.InitApexModule(module) return module } |