Kotlin 1.3.20 brings an extensive list of changes and improvements
Don’t let the number fool you! it may be a minor release but it brings some major improvements. From improvements to the compiler and IDE to building multiplatform projects via Gradle Kotlin DSL, Kotlin 1.3.20 features an extensive list of changes. Let’s have a closer look.
Even though this is a minor release, it brings tons of improvements and changes so don’t just look past it!
Let’s have a closer look at the most interesting highlights of the new release.
Faster Gradle builds by parallelizing tasks – Now runs tasks in parallel within a project. Parallel execution is supported by using the Gradle Worker API. To make use of this, first, make sure that parallel builds are enabled in Gradle (in
Multiplatform projects update – The work on multiplatform projects continues and the team improves different aspects based on community feedback. Most notably:
- Support for Kotlin Gradle DSL
- DSL improvements
- Android Library (AAR) can be a part of a multiplatform library
Improvements for inline classes – Support for inline classes has been significantly improved, and some constraints have been mitigated. There are also improvements for non-trivial cases.
Kapt improvements – Using Kapt from the command line has been simplified, allowing for direct use as a separate command line tool as opposed to having to use it via the compiler.
IntelliJ IDEA support – This release adds new refactorings, inspections, and intentions to the IntelliJ IDEA plugin. Here are the highlights:
- Template to generate
- Inspections to improve coroutines code
- New intention for converting SAM as lambda to an anonymous object
- String conversion improvements
We also see a couple of changes coming online for Kotlin/Native including:
Code contracts – Contracts functionality is now available in Kotlin/Native.
Better interop – Improved interop including support for more C constructions such as enums with forward declarations, as well as better error reporting for cases of inheritance in Objective-C.
Native frameworks from libraries – You can now produce Apple frameworks not only from source files but also from Kotlin libraries (i.e.
.klib files). This is possible using the
-Xexport-library command line option or via Gradle plugins.
Performance – Apart from reducing the memory footprint and improving runtime performance, this release also brings compiler optimizations for looping over ranges, making iterations much faster.
If you can’t wait to get started, you need to update your IntelliJ IDEA or Android Studio plugin using Tools | Kotlin | Configure Kotlin Plugin Updates and click the “Check for updates now” button. The Eclipse IDE plugin can be installed or updated via the Eclipse Marketplace (Help | Eclipse Marketplace and search for the Kotlin plugin).
You should also make sure to update the compiler and standard library versions in your Maven and Gradle build scripts.