bootclasspath_fragment must only depend on source contents

This change ensures that bootclasspath_fragment only depends on source
modules and prebuilt_bootclasspath_fragment only depends on prebuilt
modules.

It does that in two ways:
1. It adds the dependencies in ComponentDepsMutator method which is
   called before any renaming of prebuilts is done which makes it very
   easy to add a dependency directly onto either the source or prebuilt
   as required.
2. It uses a tag which prevents dependencies on a source module from
   being replaced with a dependency on a prebuilt module which ensures
   that a dependency on the source modules is not replaced with a
   dependency on a prebuilt module.

Bug: 177892522
Test: m nothing
Change-Id: Ibcfae39083afbc07fcf729ead3ed5f5d020845bf
This commit is contained in:
Paul Duffin
2021-04-20 22:47:03 +01:00
parent eaa432d470
commit 6589805e2a
3 changed files with 49 additions and 9 deletions

View File

@@ -216,6 +216,22 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
],
}
java_import {
name: "foo",
jars: ["foo.jar"],
apex_available: [
"com.android.art",
],
}
java_import {
name: "bar",
jars: ["bar.jar"],
apex_available: [
"com.android.art",
],
}
// Make sure that a preferred prebuilt doesn't affect the apex.
prebuilt_boot_image {
name: "mybootclasspathfragment",