From 2baf72190c0271c617bad5582ca5269767c03fb1 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 8 Dec 2017 00:02:43 +0000 Subject: [PATCH] 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 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/unit/Android.mk Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because SettingsUnitTests's source depends on their classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SettingsUnitTests results in duplicate classes which leads to build time and compile time issues. Bug: 30188076 Test: make checkbuild Change-Id: I191a72e50017213df6ad04f32aa660e8028720e2 --- tests/unit/Android.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/unit/Android.mk b/tests/unit/Android.mk index 58fe7dd1d21..cbf91dbab73 100644 --- a/tests/unit/Android.mk +++ b/tests/unit/Android.mk @@ -5,14 +5,19 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests LOCAL_CERTIFICATE := platform -LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common ims-common +LOCAL_JAVA_LIBRARIES := \ + android.test.runner \ + telephony-common \ + ims-common \ + android.test.base \ + android.test.mock \ + LOCAL_STATIC_JAVA_LIBRARIES := \ android-support-test \ espresso-core \ espresso-contrib-nodep \ espresso-intents-nodep \ - legacy-android-test \ mockito-target-minus-junit4 \ platform-test-annotations \ truth-prebuilt \