summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2021-11-30 00:26:56 -0800
committerLinux Build Service Account <lnxbuild@localhost>2021-11-30 00:26:56 -0800
commitd98dd11429f74dec0ff48ebfc16ca74daeea8a66 (patch)
tree2778983b8d3fb9e74cdb8960cde1bdae71953d0e
parent12ff2517c091c76fc67d2d19651773db3759b46e (diff)
parent85a62b708e47453b3a523cc9271c12ffcf1c6f02 (diff)
Merge 85a62b708e47453b3a523cc9271c12ffcf1c6f02 on remote branch
Change-Id: I771dd037cad96521e4463ee9d90b5314d2393625
-rw-r--r--apex/apex_test.go6
-rw-r--r--java/dexpreopt_bootjars.go6
2 files changed, 11 insertions, 1 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index e1b0cf2da..360c9fe3f 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -4644,6 +4644,12 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// find the dex boot jar in it. We either need to disable the source libfoo
// or make the prebuilt libfoo preferred.
testDexpreoptWithApexes(t, bp, "module libfoo does not provide a dex boot jar", preparer, fragment)
+ // dexbootjar check is skipped if AllowMissingDependencies is true
+ preparerAllowMissingDeps := android.GroupFixturePreparers(
+ preparer,
+ android.PrepareForTestWithAllowMissingDependencies,
+ )
+ testDexpreoptWithApexes(t, bp, "", preparerAllowMissingDeps, fragment)
})
t.Run("prebuilt library preferred with source", func(t *testing.T) {
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 19c65cac7..f50705cc0 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -489,7 +489,11 @@ func copyBootJarsToPredefinedLocations(ctx android.ModuleContext, srcBootDexJars
dst := dstBootJarsByModule[name]
if src == nil {
- ctx.ModuleErrorf("module %s does not provide a dex boot jar", name)
+ if !ctx.Config().AllowMissingDependencies() {
+ ctx.ModuleErrorf("module %s does not provide a dex boot jar", name)
+ } else {
+ ctx.AddMissingDependencies([]string{name})
+ }
} else if dst == nil {
ctx.ModuleErrorf("module %s is not part of the boot configuration", name)
} else {