aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2020-07-22 13:41:45 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-07-22 13:41:45 +0000
commitfb5646c48f1b05a53e60156353a9c848719451cc (patch)
tree6d2c574495308664626392d93006eccbccb08626
parentd919114006ef63a7090c1cb3881f709acf66ee92 (diff)
parentabe1e9ff3d579a055ed4ef4db50be9a1fb3ee1ba (diff)
downloadrobolectric-shadows-fb5646c48f1b05a53e60156353a9c848719451cc.tar.gz
Make robolectric runner auto-inject dependency jar am: 55539aa0a9 am: abe1e9ff3d
Original change: https://android-review.googlesource.com/c/platform/external/robolectric-shadows/+/1367134 Change-Id: Ib2c4784c2fd4fcfb6f6070c16a2d9c9425237484
-rw-r--r--Android.bp8
-rw-r--r--run_robolectric_module_tests.mk2
-rw-r--r--run_robotests.mk3
3 files changed, 9 insertions, 4 deletions
diff --git a/Android.bp b/Android.bp
index 36b5ecf98..2e19d3d01 100644
--- a/Android.bp
+++ b/Android.bp
@@ -16,9 +16,14 @@ package {
default_visibility: [":__subpackages__"],
}
+// Empty library. Should be removed
java_library {
name: "robolectric_android-all-stub",
+ visibility: ["//visibility:public"],
+}
+java_library {
+ name: "robolectric_android-all",
static_libs: [
"conscrypt",
"core-icu4j",
@@ -51,7 +56,6 @@ java_library {
],
dest: "android-all-robolectric.jar",
},
- visibility: ["//visibility:public"],
}
// build.prop file created by module type defined in soong/robolectric.go
@@ -96,7 +100,7 @@ java_genrule {
// Make robolectric_android-all-stub available as a host jar
java_device_for_host {
name: "robolectric-host-android_all",
- libs: ["robolectric_android-all-stub"],
+ libs: ["robolectric_android-all"],
}
//#############################################
diff --git a/run_robolectric_module_tests.mk b/run_robolectric_module_tests.mk
index 8bb5edf67..43c93ae61 100644
--- a/run_robolectric_module_tests.mk
+++ b/run_robolectric_module_tests.mk
@@ -35,7 +35,7 @@ ifdef test_resources_directory
endif
# Define rules that copy android-all jars to the intermediates folder.
-local_android_all_source_jar := $(call intermediates-dir-for, JAVA_LIBRARIES, robolectric_android-all-stub, , COMMON)/classes.jar
+local_android_all_source_jar := $(call java-lib-files,robolectric-host-android_all,HOST)
android_all_source_dir := prebuilts/misc/common/robolectric/android-all
android_all_target_dir := $(intermediates)/android-all
copy_android_all_jar_pairs := \
diff --git a/run_robotests.mk b/run_robotests.mk
index 8e70760ac..6251ae1ae 100644
--- a/run_robotests.mk
+++ b/run_robotests.mk
@@ -105,6 +105,7 @@ ifneq ($(DISABLE_ROBO_RUN_TESTS),true)
# The jars needed to run the tests.
my_jars := \
$(my_robolectric_jars) \
+ $(call java-lib-files,robolectric-host-android_all,HOST) \
$(call java-lib-files,junitxml) \
$(my_srcs_jars)
@@ -116,7 +117,7 @@ ifneq ($(DISABLE_ROBO_RUN_TESTS),true)
my_filename_stem := test
# Define rules that copy android-all jars to the intermediates folder.
- local_android_all_source_jar := $(call intermediates-dir-for, JAVA_LIBRARIES, robolectric_android-all-stub,,COMMON)/classes.jar
+ local_android_all_source_jar := $(call java-lib-files,robolectric-host-android_all,HOST)
android_all_lib_path := prebuilts/misc/common/robolectric/android-all
my_robolectric_path := $(intermediates.COMMON)/android-all
copy_android_all_jar_pairs := \