diff options
author | 2021-09-26 08:58:02 +0000 | |
---|---|---|
committer | 2021-09-30 10:06:24 +0000 | |
commit | ea18033f31bca4250f4ff2ab9772410910f7b49b (patch) | |
tree | 7e6f394f711e215f18f51e0844be420823feb083 /sdk/java_sdk_test.go | |
parent | 774dd305f4e9970fbf8d961db9dcf56eca8c9838 (diff) |
Add a new SDK member type java_systemserver_libs.
Similar to java_boot_libs, java_systemserver_libs only provide access
to their dex implementation jar for use by dexpreopting and do not
provide an actual implementation jar.
This is used in the subsequent CL.
Bug: 194150908
Test: m nothing
Change-Id: Ib2e7d5e6c002314a0231f46934a766f4a27e610a
Diffstat (limited to 'sdk/java_sdk_test.go')
-rw-r--r-- | sdk/java_sdk_test.go | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index 2b537398a..0d9b4a063 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -482,6 +482,71 @@ module_exports_snapshot { ) } +func TestSnapshotWithJavaSystemserverLibrary(t *testing.T) { + result := android.GroupFixturePreparers( + prepareForSdkTestWithJava, + android.FixtureAddFile("aidl", nil), + android.FixtureAddFile("resource.txt", nil), + ).RunTestWithBp(t, ` + module_exports { + name: "myexports", + java_systemserver_libs: ["myjavalib"], + } + + java_library { + name: "myjavalib", + srcs: ["Test.java"], + java_resources: ["resource.txt"], + // The aidl files should not be copied to the snapshot because a java_systemserver_libs member + // is not intended to be used for compiling Java, only for accessing the dex implementation + // jar. + aidl: { + export_include_dirs: ["aidl"], + }, + system_modules: "none", + sdk_version: "none", + compile_dex: true, + permitted_packages: ["pkg.myjavalib"], + } + `) + + CheckSnapshot(t, result, "myexports", "", + checkUnversionedAndroidBpContents(` +// This is auto-generated. DO NOT EDIT. + +java_import { + name: "myjavalib", + prefer: false, + visibility: ["//visibility:public"], + apex_available: ["//apex_available:platform"], + jars: ["java_systemserver_libs/snapshot/jars/are/invalid/myjavalib.jar"], + permitted_packages: ["pkg.myjavalib"], +} +`), + checkVersionedAndroidBpContents(` +// This is auto-generated. DO NOT EDIT. + +java_import { + name: "myexports_myjavalib@current", + sdk_member_name: "myjavalib", + visibility: ["//visibility:public"], + apex_available: ["//apex_available:platform"], + jars: ["java_systemserver_libs/snapshot/jars/are/invalid/myjavalib.jar"], + permitted_packages: ["pkg.myjavalib"], +} + +module_exports_snapshot { + name: "myexports@current", + visibility: ["//visibility:public"], + java_systemserver_libs: ["myexports_myjavalib@current"], +} +`), + checkAllCopyRules(` +.intermediates/myexports/common_os/empty -> java_systemserver_libs/snapshot/jars/are/invalid/myjavalib.jar +`), + ) +} + func TestHostSnapshotWithJavaImplLibrary(t *testing.T) { result := android.GroupFixturePreparers( prepareForSdkTestWithJava, |