From a88eb29f9e0bd363fb3f1e02f379a54324a3e5ec Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 12 Jan 2018 16:08:35 +0000 Subject: [PATCH] Remove junit classes from legacy-android-test A mistake during the conversion of the legacy-android-test target from Android.mk to Android.bp caused some junit classes to be accidentally included in the legacy-android-test target. That caused some warnings about duplicate classes to be output during the build. The junit classes are being included as part of the static library android.test.runner. This fixes that by adding a new android.test.runner-minus-junit which excludes the junit classes and then using that instead. Test: make checkbuild Change-Id: Icd00b38c64d3416a55c1055f9716ddb78ec278f8 --- test-base/Android.bp | 2 +- test-runner/Android.bp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test-base/Android.bp b/test-base/Android.bp index 30c9af1de1b0d..f6e1e515baac2 100644 --- a/test-base/Android.bp +++ b/test-base/Android.bp @@ -77,7 +77,7 @@ java_library_static { ], static_libs: [ - "android.test.runner", + "android.test.runner-minus-junit", "android.test.mock", ], diff --git a/test-runner/Android.bp b/test-runner/Android.bp index cddfef864324e..d495e90ac1d52 100644 --- a/test-runner/Android.bp +++ b/test-runner/Android.bp @@ -29,6 +29,23 @@ java_library { ], } +// Build the android.test.runner-minus-junit library +// ================================================= +// This is provided solely for use by the legacy-android-test module. +java_library { + name: "android.test.runner-minus-junit", + + srcs: ["src/android/**/*.java"], + + no_framework_libs: true, + libs: [ + "framework", + "legacy-test", + "android.test.mock", + "junit", + ], +} + // Build the repackaged.android.test.runner library // ================================================ java_library_static {