diff options
author | Paul Duffin <paulduffin@google.com> | 2020-03-09 20:23:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-03-09 20:23:15 +0000 |
commit | a81668628e7ccda49291c4b4779b02f4772affe2 (patch) | |
tree | 9234818cbe4c704435f4b490d8bc22a843e31ef9 /sdk/java_sdk_test.go | |
parent | a8e37b98bba2a8bf61d01b20994ced119a0387be (diff) | |
parent | a04c107bfaf9262daafecc9174bd9e85b79264bd (diff) |
Merge "Add support for multiple os types"
Diffstat (limited to 'sdk/java_sdk_test.go')
-rw-r--r-- | sdk/java_sdk_test.go | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index 9046eeca0..45da1f957 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -230,6 +230,72 @@ aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl ) } +func TestDeviceAndHostSnapshotWithJavaHeaderLibrary(t *testing.T) { + // b/145598135 - Generating host snapshots for anything other than linux is not supported. + SkipIfNotLinux(t) + + result := testSdkWithJava(t, ` + sdk { + name: "mysdk", + host_supported: true, + java_header_libs: ["myjavalib"], + } + + java_library { + name: "myjavalib", + host_supported: true, + srcs: ["Test.java"], + system_modules: "none", + sdk_version: "none", + compile_dex: true, + } + `) + + result.CheckSnapshot("mysdk", "", + checkAndroidBpContents(` +// This is auto-generated. DO NOT EDIT. + +java_import { + name: "mysdk_myjavalib@current", + sdk_member_name: "myjavalib", + host_supported: true, + target: { + android: { + jars: ["java/android/myjavalib.jar"], + }, + linux_glibc: { + jars: ["java/linux_glibc/myjavalib.jar"], + }, + }, +} + +java_import { + name: "myjavalib", + prefer: false, + host_supported: true, + target: { + android: { + jars: ["java/android/myjavalib.jar"], + }, + linux_glibc: { + jars: ["java/linux_glibc/myjavalib.jar"], + }, + }, +} + +sdk_snapshot { + name: "mysdk@current", + host_supported: true, + java_header_libs: ["mysdk_myjavalib@current"], +} +`), + checkAllCopyRules(` +.intermediates/myjavalib/android_common/turbine-combined/myjavalib.jar -> java/android/myjavalib.jar +.intermediates/myjavalib/linux_glibc_common/javac/myjavalib.jar -> java/linux_glibc/myjavalib.jar +`), + ) +} + func TestSnapshotWithJavaImplLibrary(t *testing.T) { result := testSdkWithJava(t, ` module_exports { |