Restrict validateApexClasspathFragments to active apex prebuilts
This is a followup to https://r.android.com/3073624 that moved
validation of bcp jars to the top-level prebuilt apex. It is possible
that there can be multiple prebuilt variants of a mainline module and
each prebuilt might have a skew in bcp jars. This CL limits the check to
only the selected apex prebuilt.
Test: go test ./apex
Bug: 328578801
Change-Id: If225a1af6004b6584b86ec442f99672f0d1f8314
diff --git a/apex/platform_bootclasspath_test.go b/apex/platform_bootclasspath_test.go
index 9f1e1e1..4a20cf0 100644
--- a/apex/platform_bootclasspath_test.go
+++ b/apex/platform_bootclasspath_test.go
@@ -865,6 +865,36 @@
},
}
+ // Another prebuilt apex, but this is not selected during the build.
+ prebuilt_apex {
+ name: "com.google.android.myapex.v2", // mainline prebuilt selection logic in soong relies on the naming convention com.google.android
+ apex_name: "myapex",
+ source_apex_name: "myapex",
+ src: "myapex.apex",
+ exported_bootclasspath_fragments: ["apex-fragment.v2"],
+ }
+
+ java_import {
+ name: "bar",
+ jars: ["bar.jar"],
+ apex_available: ["myapex"],
+ permitted_packages: ["bar"],
+ }
+
+ prebuilt_bootclasspath_fragment {
+ name: "apex-fragment.v2",
+ contents: ["bar"], // Unlike the source fragment, this is missing foo
+ apex_available:[ "myapex" ],
+ hidden_api: {
+ annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
+ metadata: "my-bootclasspath-fragment/metadata.csv",
+ index: "my-bootclasspath-fragment/index.csv",
+ stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+ all_flags: "my-bootclasspath-fragment/all-flags.csv",
+ },
+ }
+
+
apex_contributions {
name: "my_apex_contributions",
api_domain: "myapex",