Skip to content

fix(build): move kotlinx-coroutines-test from commonMain to commonTest - #258

Closed
muthuraj57 wants to merge 1 commit into
kdroidFilter:masterfrom
muthuraj57:fix-coroutines-test-scope
Closed

muthuraj57 wants to merge 1 commit into
kdroidFilter:masterfrom
muthuraj57:fix-coroutines-test-scope

Conversation

@muthuraj57

Copy link
Copy Markdown

Summary

Fixes #250. kotlinx-coroutines-test was declared in commonMain, so every consumer shipped it. Besides the size, its TestMainDispatcherFactory service can shadow the real Main dispatcher when service files are merged (e.g. a fat jar keeps only one META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory); on Linux this made every Dispatchers.Main call throw "Module with the Main dispatcher is missing". No main source uses it; it moves to commonTest.

Test plan

  • :mediaplayer:dependencies --configuration jvmRuntimeClasspath no longer lists it
  • :mediaplayer:compileKotlinJvm :mediaplayer:compileTestKotlinJvm pass

…me one

It was declared in commonMain, so every consumer shipped it, and its
TestMainDispatcherFactory service can shadow the real Main dispatcher when
service files are merged (fat jars), breaking Dispatchers.Main (kdroidFilter#250). Moved
to commonTest; no main source uses it.
@kdroidFilter

Copy link
Copy Markdown
Owner

Thank you! The code of this library now lives in the Nucleus repository (the media modules), see the README and the migration guide. Nucleus already has this: kotlinx-coroutines-test is only a test dependency. Closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] kotlinx-coroutines-test at runtime scope

3 participants