summaryrefslogtreecommitdiff
path: root/java/systemserver_classpath_fragment.go
diff options
context:
space:
mode:
author Samiul Islam <samiul@google.com> 2021-10-11 22:47:13 +0100
committer Samiul Islam <samiul@google.com> 2021-10-28 06:12:48 +0100
commit7b385c567714837acf457360111c4e7300d9d8bb (patch)
treeef7609e1729954d9b36d3ed918d2a9a75a835870 /java/systemserver_classpath_fragment.go
parentd64ab233e45cf4267b3aea5f29869a858a53c48b (diff)
Add exemption for test_framework-apexd and test_service-apexd jars
For testing purpose, we need to add java libraries to bootclasspath and systemserverclasspath that are not present in PRODUCT_APEX_BOOT_JARS and PRODUCT_APEX_SYSTEM_SERVER_JARS. Currently, we can't unconditionally add all the contents to the config for test APEXs. Until a formal way is introduced, hardcoding the artifact in the build system like how it's done for test_framework-sdkextensions. Bug: 187444679 Test: atest ApexTestCases Test: atest StagedInstallInternalTest Change-Id: I1f7b01a57bc9c46163e025de2ab00e671a42b202
Diffstat (limited to 'java/systemserver_classpath_fragment.go')
-rw-r--r--java/systemserver_classpath_fragment.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go
index b5f52fd10..d75635c43 100644
--- a/java/systemserver_classpath_fragment.go
+++ b/java/systemserver_classpath_fragment.go
@@ -124,8 +124,15 @@ func (s *SystemServerClasspathModule) configuredJars(ctx android.ModuleContext)
// So ignore it even if it is not in PRODUCT_APEX_SYSTEM_SERVER_JARS.
// TODO(b/203233647): Add better mechanism to make it optional.
_, unknown = android.RemoveFromList("car-frameworks-service-module", unknown)
- // For non test apexes, make sure that all contents are actually declared in make.
- if global.ApexSystemServerJars.Len() > 0 && len(unknown) > 0 && !android.IsModuleInVersionedSdk(ctx.Module()) {
+
+ // 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 ApexSystemServerJars. Instead,
+ // we should check if we are creating a config for apex_test via ApexInfo and amend the values.
+ // This is an exception to support end-to-end test for ApexdUnitTests, until such support exists.
+ if android.InList("test_service-apexd", possibleUpdatableModules) {
+ jars = jars.Append("com.android.apex.test_package", "test_service-apexd")
+ } else if global.ApexSystemServerJars.Len() > 0 && len(unknown) > 0 && !android.IsModuleInVersionedSdk(ctx.Module()) {
+ // For non test apexes, make sure that all contents are actually declared in make.
ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_SYSTEM_SERVER_JARS", unknown)
}