Kotlin 1.0.6 is here!

We are happy to announce the release of Kotlin 1.0.6, the new bugfix and tooling update for Kotlin 1.0. This version brings a significant number of improvements related to the IDE plugin and Android support.

We’d like to thank our external contributors whose pull requests are included in this release: Kirill Rakhman and Yoshinori Isogai. We also want to thank everyone of our EAP users for their feedback. It is really valuable for us, as always.

You can find the full list of changes in the changelog. Some of the changes worth highlighting are described below.

Convert try-finally to use() intention

We continue to add intentions for converting code to idiomatic Kotlin. The IDE now automatically suggests to replace try-finally block with the use() call when all the finally block does is closing a resource.

“Add names to call arguments” intention

Named arguments help to increase code readability. With the new “Add names to call arguments” intention you can easily add the name to an argument, or just substitute names for all call arguments at once.

Other notable IDE plugin changes

  • Inspection/intention for removing empty secondary constructor body, as well as empty primary constructor declaration;
  • “Join declaration and assignment” intention;
  • Fixes for inline functions and performance improvements in debugger;
  • Numerous fixes in intentions, KDoc and Quick Doc.

Android Support

  • Android Studio 2.3 beta 1 is now supported, as well as the Android Gradle plugin version 2.3.0-alpha3 and newer.
  • “Create XML resource” intention is added;
  • Android Extensions support is now active in the IDE only if the corresponding plugin is enabled in the build.gradle;
  • Significant number of fixes in Android Lint. Also the “Suppress Lint” intention is added.

Kapt Improvements

We continue to work on the experimental version of Kotlin annotation processing tool (kapt). While there are still some things to do in order to fully support incremental compilation, performance of the annotation processing is significantly increased since Kotlin 1.0.4.

To enable experimental kapt, just add the following line to your build.gradle:

apply plugin: 'kotlin-kapt'

All-open compiler plugin

The all-open compiler plugin makes classes annotated with a specific annotation and their members open without the explicit open keyword, so it becomes much easier to use frameworks/libraries such as Spring AOP or Mockito. You can read the detailed information about all-open in the corresponding KEEP.

We provide all-open plugin support both for Gradle and Maven, as well as the IDE integration.

How to use all-open with Gradle

If the class (or any of its superclasses) is annotated with com.your.Annotation, the class itself and all its members will become open. It even works with meta-annotations:

We also provide the “kotlin-spring” plugin that already has all required annotations for the Spring framework:

Of course, you can use both kotlin-allopen and kotlin-spring in the same project.

How to use all-open with Maven

No-arg compiler plugin

The no-arg compiler plugin generates an additional zero-argument constructor for classes with a specific annotation. The generated constructor is synthetic so it can’t be directly called from Java or Kotlin, but it can be called using reflection. You can see motivating discussion here.

How to use no-arg in Gradle

The usage is pretty similar to all-open.

How to use no-arg in Maven

How to update

To update the IDEA plugin, use Tools | Kotlin | Configure Kotlin Plugin Updates and press the “Check for updates now” button. Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts.

The command-line compiler can be downloaded from the Github release page.

As usual, if you run into any problems with the new release, you’re welcome to ask for help on the forums, on Slack (get an invite here), or to report issues in the issue tracker.

Let’s Kotlin!

Posted in Releases | Tagged | 25 Comments

Kotlin 1.1-M04 is here!

We are glad to present you the fourth milestone of the upcoming Kotlin release. We’re wrapping up the development of the version 1.1, with the final release planned for Q1 2017. Most features are already in decent shape, so it is a good time to try it and give us your feedback. We will appreciate it a lot!

As with other milestone releases, we give no backwards compatibility guarantees for new language and library features. Anything introduced in milestone releases of 1.1 is subject to change before the final 1.1 release.

Please do share your feedback regarding the new features or any problems that you may run into with this release, via YouTrack, forums and Slack.

This milestone brings a significant rework of coroutine syntax and semantics, making coroutines simpler and more flexible. It also contains standard library enhancements, new language features and compiler plugins, numerous features and improvement in the JS backend, and many other fixes and updates.
The new release also includes all features introduced in the Kotlin 1.0.6, including updates for compatibility with Android Studio 2.3 Beta 1.

The full changelog is available here and some key changes are listed below:
Continue reading

Posted in Releases | Tagged , , , | 17 Comments

Kotlin 1.1-M03 is here!

We are pleased to announce the third milestone of the upcoming Kotlin 1.1. This release brings new language features as well as improvements and fixes in the JavaScript backend, compiler and IDEA plugin. The new release also includes all tooling features introduced in Kotlin 1.0.5, and is compatible with IntelliJ IDEA 2016.3 EAP and Android Studio 2.2 and 2.3.

As with other milestone releases, we give no backwards compatibility guarantees for new language and library features. Anything introduced in milestone releases of 1.1 is subject to change before the final 1.1 release.

Please do share your feedback regarding the new features or any problems that you may run into with this release, via YouTrack, forums and Slack.

The full changelog for 1.1-M03 is available here.

Continue reading

Posted in Releases | Tagged , | 11 Comments

Kotlin Night in London Recordings

Kotlin Night in London took place October 12th, 2016 in collaboration with Trifork and GOTO London 2016. We would like to thank everyone who took the time to join us and make the event such a great success. For those who couldn’t attend or who want to rewatch the talks, the video recordings are now available for your viewing pleasure.

Continue reading

Posted in Events | Tagged | Comments Off on Kotlin Night in London Recordings

Kotlin 1.0.5 is here

We’re happy to announce that we’ve just released Kotlin 1.0.5, which continues the series of bugfix and tooling updates for Kotlin 1.0.

We’d like to thank our external contributors whose pull requests were included in this release: Kirill Rakhman, Vladislav Golub, Vsevolod Tolstopyatov, Yoshinori Isogai, takahirom and gitreelike. Thanks to everyone who tried the EAP builds and sent us feedback, too!

The complete list of changes in the release can be found in the changelog. Some of the changes worth highlighting are:

Loop to Lambda Conversion

The IntelliJ IDEA plugin can now detect many cases where imperative for loops can be rewritten in a more compact and idiomatic manner using standard library functions such as filter and map. As a simple example, the following snippet:

…will be automatically converted to:

To trigger the conversion, put the caret on the for keyword and press Alt-Enter.
Continue reading

Posted in Releases | 7 Comments

Kotlin 1.1-M02 is here!

We’re happy to announce the second milestone release of Kotlin 1.1. This release brings one long-awaited new language feature, destructuring in lambdas, as well as many improvements to features introduced in 1.1-M1, including type aliases, coroutines and bound references. The new release also includes all tooling features introduced in Kotlin 1.0.4 and 1.0.5-eap-66, and is fully compatible with IntelliJ IDEA 2016.3 EAP and Android Studio 2.2.

As with Kotlin 1.1-M01, we give no backward compatibility guarantees for new language and library features. Anything introduced in milestone releases of 1.1 is subject to change before the final 1.1 release.

And once again: please do share your feedback regarding the new language features or any problems that you may run into with this release, via YouTrack, forums and Slack.

The full changelog for 1.1-M02 is available here.

Continue reading

Posted in Releases | 13 Comments

Kotlin Night in London

We’re holding another Kotlin Night, but this time in London. We’ve brought together members of the community that have been and are currently using Kotlin in production, to come and speak to us about their experiences. As well as share some tips and tricks.

In collaboration with Trifork and GOTO London 2016, we’re holding this free event on the 12th of October 2016 at the CodeNode venue. We’ll have talks, chats and drinks.
Given spaces are limited, we encourage you to sign up sooner rather than later!

kotlinnightlondon2016

For details on talks, please check the event page.

17:30 – 18:00 – Registration and Welcome

18:00 – 18:45 – 10 Things I’m loving about Kotlin. Graham Tackley. Kaleida

18:45 – 19:30 –  Expressive Kotlin. Nat Pryce and Duncan McGregor, Springer Nature

19:30 – 20:00 – Snacks and Drinks

20:00 – 20:45 – Using Sealed Classes to build Concursus API. Dominic Fox, OpenCredo

 

GOTO Conference and Kotlin Workshop

We’re also offering a discount for GOTO London 2016 which can be used either for the conference or the full day Kotlin Workshop being held.

Posted in Uncategorized | 1 Comment

Kotlin 1.0.4 is here

We’re happy to announce the release of a new bugfix and tooling update of Kotlin, version 1.0.4. This version brings many improvements related to the IDE and build tools, as well as JavaScript support.

Once again we’d like to thank our external contributors who implemented some of the features in this release, Kirill Rakhman and Yoshinori Isogai, as well as everyone who tried the EAP builds of 1.0.4 and sent us feedback.

You can find the full list of fixes and improvements in the changelog. Some of the changes deserve special mention:

Language Change: Assignment of ‘val’ in try/catch

In versions of Kotlin before 1.0.4, you could initialize the same val both in the try and catch branches of a try/catch statement. For example, the following code was allowed:

In effect, a final variable could be assigned twice, and it was possible to observe two different values for it (for example, if the value in the try statement was captured in a lambda). In Java, the equivalent code is not allowed.

To maintain consistent semantics, the code which assigns the same val in both try and catch branches becomes a warning in Kotlin 1.0.4 and will become an error in version 1.0.5. In most cases, the code can be easily fixed by converting the code to an expression form, and the IDE will offer a quickfix to convert this code automatically. The above example would be converted to:

Continue reading

Posted in Releases | 7 Comments

Kotlin NetBeans plugin beta is out!

Today we are happy to present the first BETA release of the Kotlin plugin for the NetBeans IDE.

The main features are:

  • Building and Running Your Code
  • Maven and Ant Support
  • Java Interoperability
  • Code Highlighting
  • Diagnostics
  • Code Completion
  • Navigation
  • Debugging
  • Unit Testing
  • Auto-Import
  • Mark Occurrences
  • Quick Search
  • Code Formatting

Continue reading

Posted in Tools | 1 Comment

Kotlin census: call to action

Many times we’re asked by people working with or planning to work with Kotlin, what our adoption rate is and who’s using Kotlin and what for.

While we do accept pull requests and run into an occasional tweet we would really like to know first-hand from you, whether you’re using Kotlin in production and if so, how, and what issues you have faced. This not only helps us answer the question when someone asks about our adoption, but learn more about our community. With close to 4000 people on our Kotlin Slack alone, it’s hard to keep track of every piece of feedback!

As such, we’re asking you if you could kindly give us two minutes of your time and fill out the following survey. Please note that by providing us your details, you are not automatically giving us consent to use your name, application or company name. We would ask for written confirmation from you before doing so.

Thank you!

Posted in Uncategorized | 13 Comments