Ensure that only one dex jar is chosen for each boot image library
This change does not break modules like "core-oj" that are in multiple apexes, i.e. com.android.art, com.android.art.debug and com.android.art.testing because they all shared the same variant. So, the getBootImageJar() is only called once for that variant. Test: m droid Bug: 171061220 Change-Id: Ibf26da147af2b49ab9e4588030e8cd4002d04a7a
This commit is contained in:
@@ -495,6 +495,12 @@ func buildBootImage(ctx android.SingletonContext, image *bootImageConfig) *bootI
|
|||||||
bootDexJars := make(android.Paths, image.modules.Len())
|
bootDexJars := make(android.Paths, image.modules.Len())
|
||||||
ctx.VisitAllModules(func(module android.Module) {
|
ctx.VisitAllModules(func(module android.Module) {
|
||||||
if i, j := getBootImageJar(ctx, image, module); i != -1 {
|
if i, j := getBootImageJar(ctx, image, module); i != -1 {
|
||||||
|
if existing := bootDexJars[i]; existing != nil {
|
||||||
|
ctx.Errorf("Multiple dex jars found for %s:%s - %s and %s",
|
||||||
|
image.modules.Apex(i), image.modules.Jar(i), existing, j)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
bootDexJars[i] = j
|
bootDexJars[i] = j
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user