Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Kotlin DSL build script to align published Kotlin version with Gradle #533

Merged
merged 1 commit into from Oct 2, 2022

Conversation

cloudshiftchris
Copy link
Contributor

@cloudshiftchris cloudshiftchris commented Sep 25, 2022

Currently the build script include the Kotlin JVM distribution, specified @ v 1.7.10, and java-gradle-plugin (to publish as a plugin). This results in published version metadata for Kotlin dependency on v1.7.10, which is incorrect (it must match Gradle Kotlin version).

When using axion 1.14.1 to publish a Gradle plugin (that itself uses Kotlin) an error occurs:

e: /Users/chrislee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: /Users/chrislee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.7.10/1ef73fee66f45d52c67e2aca12fd945dbe0659bf/kotlin-stdlib-jdk7-1.7.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: /Users/chrislee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.7.10/d70d7d2c56371f7aa18f32e984e3e2e998fe9081/kotlin-stdlib-jdk8-1.7.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: /Users/chrislee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736acc4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: /Users/chrislee/.gradle/caches/modules-2/files-2.1/pl.allegro.tech.build/axion-release-plugin/1.14.1/e7bede3190c598de7e5428571b20387a88d89ea9/axion-release-plugin-1.14.1.jar!/META-INF/axion-release-plugin.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.

FAILURE: Build failed with an exception.

The idiomatic way to express a Kotlin dependency for a Gradle plugin is to use kotlin-dsl plugin, only available when the build script itself is written in Kotlin Gradle DSL.

This PR migrates the build script to semantically-equivalent Kotlin DSL syntax.

@codecov-commenter
Copy link

Codecov Report

Merging #533 (d371ec7) into main (16e4426) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main     #533   +/-   ##
=========================================
  Coverage     61.03%   61.03%           
  Complexity      384      384           
=========================================
  Files            81       81           
  Lines          1504     1504           
  Branches        141      141           
=========================================
  Hits            918      918           
  Misses          521      521           
  Partials         65       65           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cloudshiftchris
Copy link
Contributor Author

Issue #534

@cloudshiftchris cloudshiftchris changed the title Migration to Kotlin DSL build script to align published Kotlin version with Gradle Migrate to Kotlin DSL build script to align published Kotlin version with Gradle Sep 26, 2022
@bgalek
Copy link
Collaborator

bgalek commented Sep 26, 2022

@cloudshiftchris nice, thx! I'll look in to it. I'll also wanted to do this, so great timing!

@bgalek bgalek merged commit e4dc42c into allegro:main Oct 2, 2022
@cloudshiftchris cloudshiftchris deleted the kotlin-version-fix branch October 2, 2022 19:29
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.

None yet

3 participants