From a3cb6cf2e54551c01b1cec135a162532e044b19e Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 9 Nov 2020 17:36:42 +0000 Subject: Remove support for droidstubs in sdk/module_exports The droidstubs support in sdk/module_exports was a temporary measure to work around the fact that some APIs were being defined by direct use of droidstubs instead of java_sdk_library. This change removes that support as those APIs have all been switched from droidstubs to use java_sdk_library so droidstubs support is no longer needed. Bug: 168301990 Test: m nothing Change-Id: I3517bed29b030438a0423a6cb8c248992a988222 --- sdk/java_sdk_test.go | 142 --------------------------------------------------- 1 file changed, 142 deletions(-) (limited to 'sdk/java_sdk_test.go') 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 { -- cgit v1.2.3-59-g8ed1b