Use two-column format for PRODUCT_BOOT_JARS components.

The first component is the apex name, or a special name "platform"
if the boot jar is a platform jar rather than a part of some apex.
This is a prerequisite change for moving core-icu4j to a separate
com.android.i18n apex.

Old one-column format is still supported, but all unqualified
components of PRODUCT_BOOT_JARS get "platform:" prepended to them
after reading the product makefiles.

Test: aosp_walleye-userdebug boots
Bug: 138994281
Change-Id: Ic229159fdcdaf6182210a53b63850a389dd786fc
This commit is contained in:
Ulya Trafimovich
2020-04-21 15:36:33 +01:00
parent b407131a0e
commit 50c4a4b19f
6 changed files with 48 additions and 39 deletions

View File

@@ -4517,68 +4517,68 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
// updatable jar from ART apex in the ART boot image => ok
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-art-lib"}
config.ArtApexJars = []string{"com.android.art.something:some-art-lib"}
}
testNoUpdatableJarsInBootImage(t, "", bp, transform)
// updatable jar from ART apex in the framework boot image => error
error = "module 'some-art-lib' from updatable apex 'com.android.art.something' is not allowed in the framework boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"some-art-lib"}
config.BootJars = []string{"com.android.art.something:some-art-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// updatable jar from some other apex in the ART boot image => error
error = "module 'some-updatable-apex-lib' from updatable apex 'some-updatable-apex' is not allowed in the ART boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-updatable-apex-lib"}
config.ArtApexJars = []string{"some-updatable-apex:some-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// non-updatable jar from some other apex in the ART boot image => error
error = "module 'some-non-updatable-apex-lib' is not allowed in the ART boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-non-updatable-apex-lib"}
config.ArtApexJars = []string{"some-non-updatable-apex:some-non-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// updatable jar from some other apex in the framework boot image => error
error = "module 'some-updatable-apex-lib' from updatable apex 'some-updatable-apex' is not allowed in the framework boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"some-updatable-apex-lib"}
config.BootJars = []string{"some-updatable-apex:some-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// non-updatable jar from some other apex in the framework boot image => ok
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"some-non-updatable-apex-lib"}
config.BootJars = []string{"some-non-updatable-apex:some-non-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, "", bp, transform)
// nonexistent jar in the ART boot image => error
error = "failed to find a dex jar path for module 'nonexistent'"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"nonexistent"}
config.ArtApexJars = []string{"platform:nonexistent"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// nonexistent jar in the framework boot image => error
error = "failed to find a dex jar path for module 'nonexistent'"
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"nonexistent"}
config.BootJars = []string{"platform:nonexistent"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// platform jar in the ART boot image => error
error = "module 'some-platform-lib' is not allowed in the ART boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-platform-lib"}
config.ArtApexJars = []string{"platform:some-platform-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// platform jar in the framework boot image => ok
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"some-platform-lib"}
config.BootJars = []string{"platform:some-platform-lib"}
}
testNoUpdatableJarsInBootImage(t, "", bp, transform)
}