summaryrefslogtreecommitdiff
path: root/java/testing.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-10-29 13:50:24 +0100
committer Paul Duffin <paulduffin@google.com> 2021-11-01 16:40:28 +0000
commit004547facd2b7d95cbd757a7bb076ac1c1b82ab9 (patch)
tree4df242b9119c4ab29ffcf54dc141eddd57520452 /java/testing.go
parentb077bcc6bc5839de98ecb94a3416c69bc54f97c2 (diff)
Use module-lib system modules when building from prebuilts
When building from source the build uses the java system modules for the public or module APIs as needed. However, previously when building from prebuilts it would always use the public API. That difference lead to build failures when building from prebuilts. This change makes the selection of java system modules when building from prebuilts consistent with the selection when building from sources. As API levels 30 and 31 (which are the only previous releases to provide system modules) did not provide separate java system modules for the module-lib API those levels always use the public APIs. Bug: 204189791 Test: - before applying these change m TARGET_BUILD_APPS=framework-connectivity - build fails with compilation error due to missing module APIs m sdk dist cp out/dist/system-modules/module-lib/core-for-system-modules.jar prebuilts/sdk/current/module-lib/core-for-system-modules.jar - apply these changes m TARGET_BUILD_APPS=framework-connectivity - build passes as expected Change-Id: Id113ff014e7892b1009fbcaad89b1ae23a7c3b79
Diffstat (limited to 'java/testing.go')
-rw-r--r--java/testing.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/testing.go b/java/testing.go
index fafc8d760..3397e4667 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -172,9 +172,10 @@ func prebuiltApisFilesForModules(apiLevels []string, modules []string) map[strin
fs := make(map[string][]byte)
for _, level := range apiLevels {
+ apiLevel := android.ApiLevelForTest(level)
for _, sdkKind := range []android.SdkKind{android.SdkPublic, android.SdkSystem, android.SdkModule, android.SdkSystemServer, android.SdkTest} {
// A core-for-system-modules file must only be created for the sdk kind that supports it.
- if sdkKind == systemModuleKind() {
+ if sdkKind == systemModuleKind(sdkKind, apiLevel) {
fs[fmt.Sprintf("prebuilts/sdk/%s/%s/core-for-system-modules.jar", level, sdkKind)] = nil
}