Merge "Skip dexbootjar check using AllowMissingDependencies flag" am: b7e5985fd5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803934

Change-Id: I55ae4c5858330385876eb42e0fa16773ca748150
This commit is contained in:
Spandan Das
2021-08-31 16:12:21 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 1 deletions

View File

@@ -4979,6 +4979,12 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// find the dex boot jar in it. We either need to disable the source libfoo // find the dex boot jar in it. We either need to disable the source libfoo
// or make the prebuilt libfoo preferred. // or make the prebuilt libfoo preferred.
testDexpreoptWithApexes(t, bp, "module libfoo does not provide a dex boot jar", preparer, fragment) 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) { t.Run("prebuilt library preferred with source", func(t *testing.T) {

View File

@@ -500,7 +500,11 @@ func copyBootJarsToPredefinedLocations(ctx android.ModuleContext, srcBootDexJars
dst := dstBootJarsByModule[name] dst := dstBootJarsByModule[name]
if src == nil { if src == nil {
if !ctx.Config().AllowMissingDependencies() {
ctx.ModuleErrorf("module %s does not provide a dex boot jar", name) ctx.ModuleErrorf("module %s does not provide a dex boot jar", name)
} else {
ctx.AddMissingDependencies([]string{name})
}
} else if dst == nil { } else if dst == nil {
ctx.ModuleErrorf("module %s is not part of the boot configuration", name) ctx.ModuleErrorf("module %s is not part of the boot configuration", name)
} else { } else {