Merge "Make sure that classpath fragment contents appear in make vars." am: 28e5eda261 am: dbd6abe28d am: 0242867683 am: 7c61cc419d am: d95abdfbe5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1740313

Change-Id: I3e4c83daf817472de3d7e8a2112a8ad863aafda3
This commit is contained in:
satayev
2021-08-24 14:33:53 +00:00
committed by Automerger Merge Worker
6 changed files with 209 additions and 20 deletions

View File

@@ -538,7 +538,7 @@ func (b *BootclasspathFragmentModule) configuredJars(ctx android.ModuleContext)
global := dexpreopt.GetGlobalConfig(ctx)
possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, b.properties.Contents, bootclasspathFragmentContentDepTag)
jars := global.ApexBootJars.Filter(possibleUpdatableModules)
jars, unknown := global.ApexBootJars.Filter(possibleUpdatableModules)
// TODO(satayev): for apex_test we want to include all contents unconditionally to classpaths
// config. However, any test specific jars would not be present in ApexBootJars. Instead,
@@ -546,6 +546,12 @@ func (b *BootclasspathFragmentModule) configuredJars(ctx android.ModuleContext)
// This is an exception to support end-to-end test for SdkExtensions, until such support exists.
if android.InList("test_framework-sdkextensions", possibleUpdatableModules) {
jars = jars.Append("com.android.sdkext", "test_framework-sdkextensions")
} else if global.ApexBootJars.Len() != 0 && !android.IsModuleInVersionedSdk(ctx.Module()) {
unknown = android.RemoveListFromList(unknown, b.properties.Coverage.Contents)
_, unknown = android.RemoveFromList("core-icu4j", unknown)
if len(unknown) > 0 {
ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown)
}
}
return jars
}

View File

@@ -107,7 +107,16 @@ func (s *SystemServerClasspathModule) configuredJars(ctx android.ModuleContext)
global := dexpreopt.GetGlobalConfig(ctx)
possibleUpdatableModules := gatherPossibleApexModuleNamesAndStems(ctx, s.properties.Contents, systemServerClasspathFragmentContentDepTag)
return global.ApexSystemServerJars.Filter(possibleUpdatableModules)
jars, unknown := global.ApexSystemServerJars.Filter(possibleUpdatableModules)
// TODO(satayev): remove geotz ssc_fragment, since geotz is not part of SSCP anymore.
_, unknown = android.RemoveFromList("geotz", unknown)
// For non test apexes, make sure that all contents are actually declared in make.
if global.ApexSystemServerJars.Len() > 0 && len(unknown) > 0 {
ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS", unknown)
}
return jars
}
type systemServerClasspathFragmentContentDependencyTag struct {