summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2020-02-11 09:16:01 +0900
committer Jiyong Park <jiyong@google.com> 2020-02-12 10:47:36 +0900
commit6b21c7d2abb207b325fd4117d032a94b34ee2599 (patch)
tree24013cb6dafceef0b9e0423f0f33972d826adfdd /java/java.go
parent2b2aee33a77e2da23da6bfa8f3d355b21dcb4cd4 (diff)
Automatically set compile_dex:true and hostdex:true for APEX variants
... unless they are turned off explicitly. Bug: 147221965 Test: m Change-Id: I6b91d6409d9cf06ad09467c53d5d51a9c693256e
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