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
This commit is contained in:
Paul Duffin
2020-11-09 17:36:42 +00:00
parent 37fa489a9e
commit a3cb6cf2e5
2 changed files with 0 additions and 197 deletions

View File

@@ -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 {