aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Duarte <licorne@google.com>2023-09-14 20:51:49 +0000
committerDavid Duarte <licorne@google.com>2023-09-14 20:56:15 +0000
commit74c9e56a505882a68c9d300ce84714ef96f6d970 (patch)
tree8ecbb4ffc2d857caa04fca0462bcaa5154ddb4b9
parente2ece58ebfecc731282410888c0d3e983616285f (diff)
downloadkotlinx.coroutines-74c9e56a505882a68c9d300ce84714ef96f6d970.tar.gz
Exclude DebugProbesKt.bin from kotlinx_coroutines ressources
This is only used by the debugger and is causing issues to generate coverage for robolectric tests using this library Bug: 291743544 Test: java -jar jacoco-cli.jar report coverage.ec --classfiles host/testcases/ServiceBluetoothRoboTests/ServiceBluetoothRoboTests.jar --html coverage --name coverage.html Change-Id: Ia6530d180211858b3a94aef2b997c05fb7994a2e
-rw-r--r--Android.bp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index ee7cb03e..ef396c7a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -50,6 +50,13 @@ java_library_host {
"kotlinx-coroutines-core/jvm/src/test_/TestCoroutineContext.kt",
],
java_resource_dirs: ["kotlinx-coroutines-core/jvm/resources"],
+ // See https://github.com/Kotlin/kotlinx.coroutines#avoiding-including-the-debug-infrastructure-in-the-resulting-apk
+ // This file contains `kotlin.coroutines.jvm.internal.DebugProbesKt` class and is only used
+ // by the debugger.
+ // This cause issues when generating coverage as Jacoco will fail with
+ // `Caused by: java.lang.IllegalStateException: Can't add different class with same name: kotlin/coroutines/jvm/internal/DebugProbesKt`
+ // See b/291743544 for more details
+ exclude_java_resources: ["kotlinx-coroutines-core/jvm/resources/DebugProbesKt.bin"],
static_libs: [
"kotlinx_atomicfu",
],