summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaiyab Haque <thaque@codeaurora.org>2021-11-02 22:35:17 +0530
committerTaiyab Haque <thaque@codeaurora.org>2021-11-02 22:35:17 +0530
commit51c5b6b0083ca0994e3c40a2a2367fbfb5446acf (patch)
tree2778983b8d3fb9e74cdb8960cde1bdae71953d0e
parent59092278d0d07b429ac62599e774569ec6dd890c (diff)
Skip dexbootjar check using AllowMissingDependencies flag
Skip dexbootjar check using AllowMissingDependencies flag Change-Id: I969d0b4bdcd7fd7adfd1a536d0657f0b8484ccbf CRs-Fixed: 3050499
-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 {