summaryrefslogtreecommitdiff
path: root/java/bootclasspath_fragment.go
diff options
context:
space:
mode:
author satayev <satayev@google.com> 2021-08-06 13:20:28 +0100
committer satayev <satayev@google.com> 2021-08-16 12:00:25 +0100
commitd34eb0c4a6e176ca129f66f0449bd0ba19fdff5e (patch)
treed9ec7ce082ff942f98acacbbe2797c7cfacc7914 /java/bootclasspath_fragment.go
parentfc30cfc7ae35ac92d2e7b423b23c1bba8fa3f005 (diff)
Make sure that classpath fragment contents appear in make vars.
The source of truth for what jars are in BOOTCLASSPATH and SYSTEMSERVERCLASSPATH is make; adding a classpath fragment in soong with a new jar in the contents without having it declared in make is wrong (excluding test apexes). Bug: 191369843 Test: m nothing Change-Id: Ifd313776ee7ad206031244534ed3870126e4f835
Diffstat (limited to 'java/bootclasspath_fragment.go')
-rw-r--r--java/bootclasspath_fragment.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index bb542c49c..757731632 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -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
}