Kotlin 1.2.70 釋出,增量編譯速度提高 7 倍
Kotlin 1.2.70 已釋出,這是 Kotlin 1.2 的一個新的 bug 修復和工具更新版本。包括:
Kotlin/JS 增量編譯改進
Kotlin/JS 增量編譯得到了極大的改進。根據新的專案結構,這可以將開發速度提高 7 倍甚至更多。此外,Kotlin/JS Gradle builds 現在支援跨模組增量編譯。
需注意的是,增量編譯支援目前仍處於實驗階段,預設禁用,體驗前需手動啟用:
-
在 Gradle 專案中,新增
kotlin.incremental.js=true
到gradle.properties
或local.properties
-
在使用 IntelliJ IDEA 構建的專案中,轉到 Settings | Build, Execution, Deployment | Compiler| Kotlin Compiler | Kotlin to JavaScript 並檢查 Enable incremental compilation (experimental) 。
多平臺專案更新
kotlin-stdlib-common 引入了許多新的特定於平臺(platform-specific)的註釋:
@JsName
, @JvmOverloads
, @JvmStatic
, @JvmName
, @JvmMultifileClass
, @JvmField
, @JvmSuppressWildcards
, @JvmWildcard
, @Volatile
, @Transient
, @Strictfp
, 和 @Synchronized
IntelliJ IDEA 支援改進
快速修復改進
There’s a new inspection with a quick fix for converting a non-lazy collection transformations chain into a sequence equivalent. Using sequences helps avoid unnecessary temporary allocations overhead and, may significantly improve performance of complex processing pipelines:
IntelliJ IDEA 外掛的其他改進
-
Intentions to replace an
if
null-check with?.let
and the other way around -
Inspection to detect unnecessary
with
calls -
Intention to convert a property getter to initializer
-
Inspection and quickfix to replace
assertTrue(a == b)
withassertEquals(a, b)
-
“Redundant return label” inspection
-
Quick-fix for default parameter value removal
-
“
forEach
parameter unused” inspection -
Lots of bug fixes and performance improvements
更多詳情可查閱發行說明:
-
ofollow,noindex">https://blog.jetbrains.com/kotlin/2018/09/kotlin-1-2-70-is-out/