Append platform classpath proto configs with missing apex jars.
Any apex classpath fragment that doesn't generate its own classpaths proto, must still propagate it's boot jars for the platform classpath fragment to include for complete CLASSPATH variables on device. Bug: 191127295 Test: atest CtsClasspathsTestCases derive_classpath_test Change-Id: I93687f69006741fcd66eb6e04891a4b4bbcc3b47
This commit is contained in:
@@ -481,3 +481,62 @@ func CheckModuleDependencies(t *testing.T, ctx *android.TestContext, name, varia
|
||||
pairs := java.ApexNamePairsFromModules(ctx, modules)
|
||||
android.AssertDeepEquals(t, "module dependencies", expected, pairs)
|
||||
}
|
||||
|
||||
// TestPlatformBootclasspath_IncludesRemainingApexJars verifies that any apex boot jar is present in
|
||||
// platform_bootclasspath's classpaths.proto config, if the apex does not generate its own config
|
||||
// by setting generate_classpaths_proto property to false.
|
||||
func TestPlatformBootclasspath_IncludesRemainingApexJars(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForTestWithPlatformBootclasspath,
|
||||
prepareForTestWithMyapex,
|
||||
java.FixtureConfigureUpdatableBootJars("myapex:foo"),
|
||||
android.FixtureWithRootAndroidBp(`
|
||||
platform_bootclasspath {
|
||||
name: "platform-bootclasspath",
|
||||
fragments: [
|
||||
{
|
||||
apex: "myapex",
|
||||
module:"foo-fragment",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
bootclasspath_fragments: ["foo-fragment"],
|
||||
updatable: false,
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
bootclasspath_fragment {
|
||||
name: "foo-fragment",
|
||||
generate_classpaths_proto: false,
|
||||
contents: ["foo"],
|
||||
apex_available: ["myapex"],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "foo",
|
||||
srcs: ["a.java"],
|
||||
system_modules: "none",
|
||||
sdk_version: "none",
|
||||
compile_dex: true,
|
||||
apex_available: ["myapex"],
|
||||
permitted_packages: ["foo"],
|
||||
}
|
||||
`),
|
||||
).RunTest(t)
|
||||
|
||||
java.CheckClasspathFragmentProtoContentInfoProvider(t, result,
|
||||
true, // proto should be generated
|
||||
"myapex:foo", // apex doesn't generate its own config, so must be in platform_bootclasspath
|
||||
"bootclasspath.pb",
|
||||
"out/soong/target/product/test_device/system/etc/classpaths",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user