![]() For example, on newer macOS versions it’s hard to find working JDK 1.6 and JDK 1.7 releases. ![]() This was already a painful step for several reasons. To start working with a Kotlin project, a contributor had to install a variety of JDKs locally. Additionally, it uses different JDKs inside the compiler, and the build tool tests to verify that the compiler’s output works correctly with the different JDKs. Kotlin 1.6.0 supports JDK versions from JDK 1.6 through 17 (the latest released version at the moment). Kotlin repository suffered as wellĪs you may have already guessed, this is how it was in the Kotlin repository itself. Unfortunately, the Kotlin Gradle plugin did not consider the JDK version as a task input until the Kotlin 1.5.30 release. Even then, errors may slip through and the Gradle remote build cache could be populated with a wrong entry, leading to a hard-to-debug error in later release builds. You need to add extensive documentation on how to set up the build environment, some custom build scripts to pick up the correct JDK version for the specific compile or test task, and a complex CI setup. This becomes even more complicated when your project has to support different JDK versions to compile itself or to run the tests against. ![]() One of the common user mistakes is using the wrong JDK version to compile the project, which leads to strange errors. Imagine you maintain a Gradle build setup for some JVM library or application. What is the Gradle JVM toolchain feature and how to use it? Issues with building Gradle JVM projects This feature provides a simple way to have a reproducible build independent from the user JDK, plus it reduces the complexity of working with multiple JDKs. In this blog post, we’ll tell you about one of the Gradle features that Kotlin has recently added support for – JVM toolchain. ![]() Maintaining Gradle build setups to have a reliable and reproducible build process is not always easy. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |