name:"Bootclasspath apex jar not satisfying allowed module packages.",
expectedError:`module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only allow these packages: foo.bar. Please jarjar or move code around.`,
name:"Bootclasspath apex jar not satisfying allowed module packages on Q.",
expectedError:`module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only allow these packages: foo.bar with min_sdk < T. Please jarjar or move code around.`,
name:"Bootclasspath apex jar not satisfying allowed module packages on R.",
expectedError:`module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only allow these packages: foo.bar with min_sdk < T. Please jarjar or move code around.`,
bp:`
java_library {
name: "bcp_lib1",
srcs: ["lib1/src/*.java"],
apex_available: ["myapex"],
permitted_packages: ["foo.bar"],
sdk_version: "none",
system_modules: "none",
min_sdk_version: "30",
}
java_library {
name: "bcp_lib2",
srcs: ["lib2/src/*.java"],
apex_available: ["myapex"],
permitted_packages: ["foo.bar", "bar.baz"],
sdk_version: "none",
system_modules: "none",
min_sdk_version: "30",
}
apex {
name: "myapex",
min_sdk_version: "30",
key: "myapex.key",
java_libs: ["bcp_lib1", "bcp_lib2"],
updatable: false,
}
`,
bootJars:[]string{"bcp_lib1","bcp_lib2"},
modulesPackages:map[string][]string{
"myapex":[]string{
"foo.bar",
},
},
},
{
name:"Bootclasspath apex jar >= T not satisfying Q/R/S allowed module packages.",