Add bazel rules for referencing android.test APIs when using android-28.
The android.test classes have been moved from the android.jar in android-28. This CL attempts to add a rule for accessing them.
@@ -91,6 +91,18 @@ def create_android_sdk_rules(
jars = ["platforms/android-%d/optional/org.apache.http.legacy.jar" % api_level],
)
+ if api_level >= 28:
+ # Android 28 removed most of android.test from android.jar and moved it
+ # to separate jars.
+ native.java_import(
+ name = "legacy_test-%d" % api_level,
+ jars = [
+ "platforms/android-%d/optional/android.test.base.jar" % api_level,
+ "platforms/android-%d/optional/android.test.mock.jar" % api_level,
+ "platforms/android-%d/optional/android.test.runner.jar" % api_level,
+ ],
+ )
+
native.android_sdk(
name = "sdk-%d" % api_level,
build_tools_version = build_tools_version,
