diff options
author | David Duarte <licorne@google.com> | 2023-09-14 20:51:49 +0000 |
---|---|---|
committer | David Duarte <licorne@google.com> | 2023-09-14 20:56:15 +0000 |
commit | 74c9e56a505882a68c9d300ce84714ef96f6d970 (patch) | |
tree | 8ecbb4ffc2d857caa04fca0462bcaa5154ddb4b9 | |
parent | e2ece58ebfecc731282410888c0d3e983616285f (diff) | |
download | kotlinx.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.bp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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", ], |