diff options
Diffstat (limited to 'sdk/java_sdk_test.go')
-rw-r--r-- | sdk/java_sdk_test.go | 142 |
1 files changed, 0 insertions, 142 deletions
diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index e19d6dae6..731e528bf 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -619,148 +619,6 @@ module_exports_snapshot { ) } -func testSdkWithDroidstubs(t *testing.T, bp string) *testSdkResult { - t.Helper() - - fs := map[string][]byte{ - "foo/bar/Foo.java": nil, - "stubs-sources/foo/bar/Foo.java": nil, - } - return testSdkWithFs(t, bp, fs) -} - -// Note: This test does not verify that a droidstubs can be referenced, either -// directly or indirectly from an APEX as droidstubs can never be a part of an -// apex. -func TestBasicSdkWithDroidstubs(t *testing.T) { - testSdkWithDroidstubs(t, ` - sdk { - name: "mysdk", - stubs_sources: ["mystub"], - } - sdk_snapshot { - name: "mysdk@10", - stubs_sources: ["mystub_mysdk@10"], - } - prebuilt_stubs_sources { - name: "mystub_mysdk@10", - sdk_member_name: "mystub", - srcs: ["stubs-sources/foo/bar/Foo.java"], - } - droidstubs { - name: "mystub", - srcs: ["foo/bar/Foo.java"], - sdk_version: "none", - system_modules: "none", - } - java_library { - name: "myjavalib", - srcs: [":mystub"], - sdk_version: "none", - system_modules: "none", - } - `) -} - -func TestSnapshotWithDroidstubs(t *testing.T) { - result := testSdkWithDroidstubs(t, ` - module_exports { - name: "myexports", - stubs_sources: ["myjavaapistubs"], - } - - droidstubs { - name: "myjavaapistubs", - srcs: ["foo/bar/Foo.java"], - system_modules: "none", - sdk_version: "none", - } - `) - - result.CheckSnapshot("myexports", "", - checkAndroidBpContents(` -// This is auto-generated. DO NOT EDIT. - -prebuilt_stubs_sources { - name: "myexports_myjavaapistubs@current", - sdk_member_name: "myjavaapistubs", - visibility: ["//visibility:public"], - srcs: ["java/myjavaapistubs_stubs_sources"], -} - -prebuilt_stubs_sources { - name: "myjavaapistubs", - prefer: false, - visibility: ["//visibility:public"], - srcs: ["java/myjavaapistubs_stubs_sources"], -} - -module_exports_snapshot { - name: "myexports@current", - visibility: ["//visibility:public"], - stubs_sources: ["myexports_myjavaapistubs@current"], -} - -`), - checkAllCopyRules(""), - checkMergeZips(".intermediates/myexports/common_os/tmp/java/myjavaapistubs_stubs_sources.zip"), - ) -} - -func TestHostSnapshotWithDroidstubs(t *testing.T) { - result := testSdkWithDroidstubs(t, ` - module_exports { - name: "myexports", - device_supported: false, - host_supported: true, - stubs_sources: ["myjavaapistubs"], - } - - droidstubs { - name: "myjavaapistubs", - device_supported: false, - host_supported: true, - srcs: ["foo/bar/Foo.java"], - system_modules: "none", - sdk_version: "none", - } - `) - - result.CheckSnapshot("myexports", "", - checkAndroidBpContents(` -// This is auto-generated. DO NOT EDIT. - -prebuilt_stubs_sources { - name: "myexports_myjavaapistubs@current", - sdk_member_name: "myjavaapistubs", - visibility: ["//visibility:public"], - device_supported: false, - host_supported: true, - srcs: ["java/myjavaapistubs_stubs_sources"], -} - -prebuilt_stubs_sources { - name: "myjavaapistubs", - prefer: false, - visibility: ["//visibility:public"], - device_supported: false, - host_supported: true, - srcs: ["java/myjavaapistubs_stubs_sources"], -} - -module_exports_snapshot { - name: "myexports@current", - visibility: ["//visibility:public"], - device_supported: false, - host_supported: true, - stubs_sources: ["myexports_myjavaapistubs@current"], -} -`), - checkAllCopyRules(""), - checkMergeZips(".intermediates/myexports/common_os/tmp/java/myjavaapistubs_stubs_sources.zip"), - ) -} - func TestSnapshotWithJavaSystemModules(t *testing.T) { result := testSdkWithJava(t, ` sdk { |