summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-02-12 05:35:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-02-12 05:35:25 +0000
commit66557562302a0fe419772ee9ac5911e4a1569fc5 (patch)
treed5f9dab70e4852f6bbc0f13a086abd47fabadff6 /java/java.go
parent19d84a0f3e6884f2fa0a2cd025e6f273507a74ae (diff)
parent6b21c7d2abb207b325fd4117d032a94b34ee2599 (diff)
Merge "Automatically set compile_dex:true and hostdex:true for APEX variants"
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index dd44d06aa..279d67424 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1475,6 +1475,16 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
j.implementationAndResourcesJar = implementationAndResourcesJar
+ // Enable dex compilation for the APEX variants, unless it is disabled explicitly
+ if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !j.IsForPlatform() {
+ if j.deviceProperties.Compile_dex == nil {
+ j.deviceProperties.Compile_dex = proptools.BoolPtr(true)
+ }
+ if j.deviceProperties.Hostdex == nil {
+ j.deviceProperties.Hostdex = proptools.BoolPtr(true)
+ }
+ }
+
if ctx.Device() && j.hasCode(ctx) &&
(Bool(j.properties.Installable) || Bool(j.deviceProperties.Compile_dex)) {
// Dex compilation