aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-12-08 00:02:43 +0000
committerPaul Duffin <paulduffin@google.com>2017-12-08 00:09:05 +0000
commit702ce7a78cfca923997e84f953c30cdc24146d12 (patch)
tree12dcd799a2714613072bcad84101ffa909db1cb0
parent5c56c636263f75acd976208f0702e5c6eee5c9ac (diff)
downloadContactsProvider-702ce7a78cfca923997e84f953c30cdc24146d12.tar.gz
Stop statically including legacy-android-test
Statically including legacy-android-test leads to duplicate classes which causes build time problems (with Proguard) and runtime problems on older SDK versions. This change: * Stops statically including legacy-android-test. * Adds compile time dependencies on andoid.test.base, android.test.mock and android.test.runner where necessary. * Adds <uses-library android:name="android.test.runner"/> to any affected package to ensure that the classes that were included by legacy-android-test are still available at runtime. That also adds a dependency on android.test.base and android.test.mock. The following change descriptions were generated automatically and so may be a little repetitive. They are provided to give the reviewer enough information to check the comments match what has actually been changed and check the reasoning behind the changes. * tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ContactsProviderTests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because ContactsProviderTests's source depends on their classes and because of these changes they are no longer present on the compilation path. * tests2/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ContactsProviderTests2 results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because ContactsProviderTests2's source depends on its classes and because of these changes they are no longer present on the compilation path. Bug: 30188076 Test: make checkbuild Change-Id: Ib9e624d4e31d65e92f5c040916230e6df0a0e8cb
-rw-r--r--tests/Android.mk5
-rw-r--r--tests2/Android.mk5
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index 8df1d6d4..e0c62843 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -7,10 +7,9 @@ LOCAL_MODULE_TAGS := tests
LOCAL_STATIC_JAVA_LIBRARIES := \
ContactsProviderTestUtils \
android-support-test \
- mockito-target-minus-junit4 \
- legacy-android-test
+ mockito-target-minus-junit4
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
# Only compile source java files in this apk.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests2/Android.mk b/tests2/Android.mk
index bb4443f3..4a0fdfb0 100644
--- a/tests2/Android.mk
+++ b/tests2/Android.mk
@@ -22,10 +22,9 @@ LOCAL_MODULE_TAGS := tests
LOCAL_STATIC_JAVA_LIBRARIES := \
ContactsProviderTestUtils \
android-support-test \
- mockito-target-minus-junit4 \
- legacy-android-test
+ mockito-target-minus-junit4
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_SRC_FILES := $(call all-java-files-under, src)