Skip to content

5.4.2

Compare
Choose a tag to compare
@LeoColman LeoColman released this 13 Aug 17:36
8101fdd
Add test for Gradle plugin and fix issues running tests for native ta…

…rgets on Kotlin 1.7+ (#3107)

* Add (currently failing) test for Gradle plugin, and improve warnings generated by plugin when invalid configuration is detected.

* Fix issue where compilation for Kotlin/Native and Kotlin/JS projects would fail if the project uses Kotlin 1.7.

* Fix issue running Kotest tests under Kotlin 1.5.

The current version of Gradle uses Kotlin 1.5, so retaining backwards
compatibility with Kotlin 1.5 allows us to use Kotest to write tests
for Gradle plugins.

Resolves https://github.com/kotest/kotest/issues/3059.

* Fix issue where Gradle plugin tests could fail due to conflicting with other concurrent build tasks.

* Remove Gradle plugin test for now.

See https://github.com/kotest/kotest/pull/3075#issuecomment-1181554021.

* Revert "Remove Gradle plugin test for now."

This reverts commit ec14c550beba282e60a6e10bfad8c07121478a15.

* Disable JS browser test for now.

* Fix issue where no tests are run when targeting a native platform using Kotlin 1.7.

Kotlin 1.7 now uses the embeddable compiler JAR and corresponding
plugins (from "getPluginArtifact" rather than
"getPluginArtifactForNative" in KotestMultiplatformCompilerGradlePlugin)
by default for all platforms.

This means that the "JS" compiler plugin is used by all targets by
default in projects that use Kotlin 1.7+.

As a first step, I've brought the existing native plugin code over to
the "JS" plugin. Next steps are to rename the projects to make their
intention clearer and merge the transformers used by each platform.

* Rename JS compiler plugin project to better reflect its purpose.

* Update package name to match project name.

* Rename "native" compiler plugin project to better reflect its purpose.

* Refactor transformers to share more logic.

* Add tests to ensure Kotest behaves correctly with Kotlin/Native memory model.

* Extract further common functionality.

* Configure project config objects when running on Kotlin/Native.

* Reorder method calls in native transformer to match JS transformer.

* Further consolidate IR generation logic into base Transformer class.

* Fix issues running compiler plugin on modules that do not contain any Kotest tests.

* Add workaround for issues running Gradle plugin tests on GitHub Actions.

* Revert "Add workaround for issues running Gradle plugin tests on GitHub Actions."

This reverts commit 9df35f8df1629f32ed50976719d22a3fe6a85b52.

* Set target JVM versions for all libraries.

* Add Yarn lock file.

* Run Gradle plugin tests in a separate GitHub Actions job.

Co-authored-by: Sam <sam@sksamuel.com>