Extract current Kotlin version value into a separate class

In order to selectively ignore it during classpath normalization,
and do not recompile all the dependencies when just the version value
changes.
This commit is contained in:
Ilya Gorbunov
2020-07-09 17:16:45 +03:00
parent cb513b9a70
commit dd47962ad0
2 changed files with 9 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -72,6 +72,12 @@ public class KotlinVersion(val major: Int, val minor: Int, val patch: Int) : Com
* Returns the current version of the Kotlin standard library.
*/
@kotlin.jvm.JvmField
public val CURRENT: KotlinVersion = KotlinVersion(1, 4, 255) // value is written here automatically during build
public val CURRENT: KotlinVersion = KotlinVersionCurrentValue.get()
}
}
// this class is ignored during classpath normalization when considering whether to recompile dependencies in Kotlin build
private object KotlinVersionCurrentValue {
@kotlin.jvm.JvmStatic
fun get(): KotlinVersion = KotlinVersion(1, 4, 255) // value is written here automatically during build
}