mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.09k stars 198 forks source link

Move tests to included build to separate classpaths #502

Closed TWiStErRob closed 7 months ago

TWiStErRob commented 7 months ago

Thank you for submitting a pull request! But first:

Fixes:

> Configure project :tests
project ':tests' uses Kotlin 1.9.20

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':mockito-kotlin', ':tests'

The solution requires some explanation while refactoring from the old one. I'll comment on each change to clarify what it does and why it's needed. This is the Gradle-idiomatic way of sharing code between two "independent" projects.

TWiStErRob commented 7 months ago

Weird error, will rebase and try to fix.

TWiStErRob commented 7 months ago

@TimvdLippe This is ready on my side

TimvdLippe commented 7 months ago

Thanks for all the fixes!