1. 程式人生 > >Kotlin 1.2.50 is out!

Kotlin 1.2.50 is out!

We’re happy to announce the release of Kotlin 1.2.50, a new bugfix and tooling update for Kotlin 1.2. This release:

  • Updates Kotlin support in the Eclipse IDE plugin
  • Adds new functions in common and JS parts of the standard library
  • Brings JUnit 5 support to kotlin.test
  • Improves experimental scripting support
  • Introduces Runnable Kotlin scratch files in IntelliJ IDEA
  • Speeds up building multimodule Android projects with Gradle
  • Updates experimental @JvmDefault support with a binary compatibility mode
  • Introduces a progressive compiler mode
  • Fixes a lot of known issues in the compiler and the IDE plugin and provides performance improvements

The update is compatible with all versions of IntelliJ IDEA from 2017.2 to 2018.2 EAP, as well as with Android Studio 3.0, 3.1, and 3.2 Canary.

The complete list of changes in this release can be found in the changelog. Read on for the highlights.

Eclipse IDE plugin update

We are proud to present the new 0.8.5 release of our plugin for the Eclipse IDE. Along with support for the Kotlin 1.2.50 compiler, this update brings several features and improvements such as:

  • support for the Kotlin compiler plugins like kotlin-allopen and kotlin-spring
  • preferences in configuring the version of the generated JVM bytecode
  • bug-fixes in the debugger and J2K converter

Workspace-wide Kotlin compiler preferences, which allow you to configure compiler plugins and other compiler options, can be found in Preferences | Kotlin | Compiler. It is also possible to configure only project-level settings.

The updated Kotlin Eclipse Plugin is available on the Eclipse Marketplace. See the ‘Getting Started’ tutorial for details.

Library updates

In this update, a set of toString(radix: Int) extension functions for Byte, Short, Int, and Long were added to the common and Kotlin/JS parts of the standard library, thanks to our contributor Florian Steitz. They are ready for use in experimental multiplatform projects and projects targeting JavaScript.

Another addition to the common and Kotlin/JS standard library parts are the two constructors, String(chars: CharArray) and String(chars: CharArray, offset: Int, length: Int). These are meant for efficient conversion of a CharArray to String. This change was contributed by Valeriy Zhirnov.

Also, the kotlin.test library now supports testing with the JUnit 5 framework with a separate module kotlin-test-junit5, which provides an implementation of Asserter on top of JUnit 5 and maps the test annotations from kotlin-test-annotations-common to the JUnit 5 test annotations.

Improved experimental scripting support

This release introduced new experimental scripting support that allows easier kotlin scripts customization, simpler use of the scripts with standard compiler and IDEA plugin, and simpler scripting host creation and embedding. The complete Kotlin scripting proposal along with the current implementation state could be found in the appropriate KEEP. Some highlights include:

  • it is now possible to create a jar defining a script and if that jar is added to the compilation classpath, the scripts of this type will be automatically supported by the compiler and IDEA plugin
  • it is now possible to pass typed external variables to the script compilation, so they will be accessible as if they are global variables defined outside of the script
  • the structure of the scripting support is now much simpler and provided helpers allow to implement and embed a custom scripting host much easier than before

IntelliJ IDEA plugin improvements

Runnable Kotlin scratch files and Kotlin scripts

The update of the Kotlin IntelliJ IDEA plugin introduces support for runnable Kotlin scratch files. These can use the declarations from the code in the project as well:

Besides, IDE support for Kotlin Script (*.kts) files has been improved. You can now create new scripts in the Project View and run them within the classpath of the module they are placed in.

Raw strings input and indentation

The updated IDE plugin makes it easier to type raw string literals, as it now inserts the pairing """ automatically and provides an intention to indent the literal (thanks to our contributor Toshiaki Kameyama). This is useful when you paste a multiline string:

Other improvements in the IntelliJ IDEA plugin

  • A few new inspections and intentions that are here to help with kotlinx.coroutines – these detect unused Deferred and async results and convert async(ctx) { }.await() to withContext(ctx) { }.
  • An intention to convert end-of-line comments into block ones and vice versa.
  • A lot of bugfixes, stability improvements and performance optimizations.

Faster Gradle builds

Starting with Kotlin 1.2.50, Kotlin tracks changes incrementally across the modules of a multimodule Android project. This results in significantly faster incremental builds of large Android projects with multiple interdependent modules.

Changes in the compiler

The Kotlin 1.2.50 update fixes a lot of known issues in the compiler, delivers performance and stability improvements, and adds the new features listed below.

Progressive compiler mode

While most bugs and inconsistencies found in the Kotlin compiler are fixed as soon as possible, some of the fixes may potentially be backward-incompatible. The Kotlin compatibility policy requires us to introduce such fixes only in major releases (such as 1.1 and 1.2) and go through lengthy migration cycles. We, however, believe that many users will benefit from these bug-fixes being delivered quicker, making their code safer and cleaner.

In this release, we introduce an experimental progressive compiler mode intended for actively developed codebases whose maintainers regularly update to latest versions of the Kotlin compiler and tools. In this mode, some of the deprecations and bug-fixes for unstable code take effect immediately. Consequently, some code may break upon enabling the mode or upon updating Kotlin to future versions while keeping the progressive mode enabled.

Fixes that are chosen to be enabled in the progressive mode won’t affect too many places in the codebases, though they won’t work silently and will require the maintainers to fix the erroneous pieces of code. We are going to provide automated migration tools in the IDE plugin for this where possible. Any code fixed in this way will stay valid outside the progressive mode, too. For examples of issues with fixes applied in the progressive mode, see KT-9580, KT-16681, or KT-17981.

You can enable the progressive mode on a per-module basis by adding the flag -Xprogressive to the arguments passed to the Kotlin compiler.

@JvmDefault binary compatibility mode

Experimental support for generating default methods for JVM interfaces with @JvmDefault has been updated to compile the default methods in a way that is binary-compatible with normal default implementations in Kotlin interfaces. To switch to this mode, use the compiler flag -Xjvm-default=compatibility.

Also note that the compiler flag -Xenable-jvm-default introduced in Kotlin 1.2.40 is no longer supported. Please use -Xjvm-default=enable instead.

Argument files

Kotlin 1.2.50 supports passing compiler arguments in a file with the command line option -Xargfile=args.txt, which helps call the command line compiler with long filesystem paths in the arguments.

How to update

To update your IntelliJ IDEA or Android Studio plugin, use 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).

Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts.

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!

相關推薦

Kotlin 1.2.50 is out!

We’re happy to announce the release of Kotlin 1.2.50, a new bugfix and tooling update for Kotlin 1.2. This release: Updates Kotlin support in

Kotlin 1.2.30 is out

We’re happy to announce the release of Kotlin 1.2.30, a new bugfix and tooling update for Kotlin 1.2. This update: Adds a new declaration in

Kotlin 1.2.60 is out!

We’re happy to announce the release of Kotlin 1.2.60, a new bugfix and tooling update for Kotlin 1.2. This release: Adds optional expected an

Kotlin 1.2.40 is out!

We’re happy to announce the release of Kotlin 1.2.40, a new bugfix and tooling update for Kotlin 1.2! This update: Allows platform modules in

Kotlin 1.2.70 is Out!

We’re happy to announce the release of Kotlin 1.2.70, a new bugfix and tooling update for Kotlin 1.2. This release: Significantly improves in

springboot 1.5.10 +kotlin 1.2.20 解決 java.lang.ClassNotFoundException: kotlin.reflect.KotlinReflectionInternalError

exceptio pri pla nbsp http art fas cep start.s 使用http://start.spring.io/ 下載的 項目 跑單元測試 報 java.lang.ClassNotFoundException: kotlin.reflect.

Kotlin 1.2 新特性

Kotlin JavaScript JVM 點擊關註異步圖書,置頂公眾號每天與你分享IT好書 技術幹貨 職場知識在Kotlin 1.1中,團隊正式發布了JavaScript目標,允許開發者將Kotlin代碼編譯為JS並在瀏覽器中運行。在Kotlin 1.2中,團隊增加了在JVM和JavaScrip

Kotlin 1.3 RC is Here: Migrate Your Coroutines!

We’re proud to introduce Kotlin 1.3-RC, the latest preview and release candidate for 1.3.0. This release mostly contains critical bug-fixes re

index 2 is out of bounds for axis 1 with size 2

在使用類似  keras.np_utils.to_categorical 的函式,對標籤轉換成one-hot編碼的時候,要使標籤從0開始。即如果是兩類,設標籤裡面的內容為0和1,不能設定為1和2或其他數字。 比如: from keras.utils import np_util

Python實現groupBy函數。grpby = groupBy(lambda x: x%2 is 1),grpby([1, 2, 3])的結果為{True: [1, 3], False: [2]}

結果 false n) pen als 不存在 def lam nbsp def groupBy(fn): def go(lst): m = {} for v in lst: m[fn(v)].append(v) if m.get(fn(v

Error:Minimum supported Gradle version is 2.14.1. Current version is 2.10.原因分析和解決。

圖片 幫助 url err ... tle IT .net fcm 最近和主管一起開發項目一直出現這個問題: Error:Minimum supported Gradle version is 2.14.1. Current version is 12.10. If usi

解決 You are using pip version 7.1.2, however version 18.0 is available.報錯

完美 bsp -- 安裝目錄 方法 exe win .exe 嘗試 Windows下安裝 Pyhton的mysql庫時 命令行一直報 You are using pip version 7.1.2, however version 18.0 is available

[python問題] You are using pip version 7.1.2, however version 18.1 is available

 在windows環境下在安裝paramiko的時候 ,使用命令python -m pip install paramiko 一直報錯  You are using pip version 7.1.2, however version 18.1 is available  解決辦法,pip版本升級。在Py

ubuntu18.04安裝pip3 Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed

下了個ubuntu18.04,更新源後安裝pip3 apt install python3-pip 結果居然報錯了 Reading package lists... Done Building dependency tree Reading state inf

解決MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.(win10)

一、問題情境 本想用django搭建個小部落格,但是在Windows10的DOS下安裝mysql驅動時, 總是報錯:MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.

python報錯 ValueError: dictionary update sequence element #0 has length 1; 2 is require

原文連結地址: https://blog.csdn.net/weixin_40894428/article/details/80683137 字串轉字典要用eval(),這個方法很多書上都沒有介紹, 有關eval()的用法,傳送門: http://www.runoob.com/python/

安裝MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.

安裝了python,想用python來連線資料庫,需要安裝mysql-python包。 在https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

Spring Boot - An incompatible version [1.2.12] of the APR based Apache Tomcat Native library is...

Spring Boot在目前的專案開發中已經逐步火熱起來,既然是一種技術在使用的過程中出現問題在所難免,在一次初始化Spring Boot專案啟動時,我遇到了一個啟動失敗的問題,日誌給出的資訊An incompatible version [1.1.14] of the APR ba

Spring Security(二):2.1 Introduction What is Spring Security?

Spring Security provides comprehensive security services for Java EE-based enterprise software applications. There is a particular emphasis on supporting p

Hive Schema version 2.1.0 does not match metastore's schema version 1.2.0 Metastore is not upgraded

hive啟動報錯,這裡很顯然可以看出錯誤是說2.1.0版本的hive不能匹配hive1.2.0的metastore,所以需要將hive的元資料資訊的版本更改一下 Caused by: MetaException(message:Hive Schema version 2.1.0 d