Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10ea4bf9 authored by Spandan Das's avatar Spandan Das
Browse files

Skip dexbootjar check using AllowMissingDependencies flag

Soong checks that every module part of a bootclass_fragment provides a
dex boot jar file, even if the module is not a dependency of vendor.img

Using AllowMissingDepdencies() to skip this check allows vendors to be
more aggressive in removing projects from their source tree

Test: In build/soong, run go test ./...
Test: m nothing
Bug: 196306898
Bug: 192616764
Change-Id: I78b062afdc19a6a3251aa8552230f3fcf334b6fb
parent 7c16dabf
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5090,6 +5090,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) {
+5 −1
Original line number Diff line number Diff line
@@ -500,7 +500,11 @@ func copyBootJarsToPredefinedLocations(ctx android.ModuleContext, srcBootDexJars
		dst := dstBootJarsByModule[name]

		if src == nil {
			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 {