Skip to content

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

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

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.

This branch has not been deployed

No deployments
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

2 participants