Switch Kotlin version to 2.0
#KT-59171 In Progress
This commit is contained in:
committed by
Space Team
parent
68ca571528
commit
5fb38008b7
@@ -24,8 +24,8 @@ private val LANGUAGE_TO_METADATA_VERSION = EnumMap<LanguageVersion, JvmMetadataV
|
||||
this[LanguageVersion.KOTLIN_1_6] = JvmMetadataVersion(1, 6, 0)
|
||||
this[LanguageVersion.KOTLIN_1_7] = JvmMetadataVersion(1, 7, 0)
|
||||
this[LanguageVersion.KOTLIN_1_8] = JvmMetadataVersion(1, 8, 0)
|
||||
this[LanguageVersion.KOTLIN_1_9] = JvmMetadataVersion.INSTANCE
|
||||
this[LanguageVersion.KOTLIN_2_0] = JvmMetadataVersion(2, 0, 0)
|
||||
this[LanguageVersion.KOTLIN_1_9] = JvmMetadataVersion(1, 9, 0)
|
||||
this[LanguageVersion.KOTLIN_2_0] = JvmMetadataVersion.INSTANCE
|
||||
this[LanguageVersion.KOTLIN_2_1] = JvmMetadataVersion(2, 1, 0)
|
||||
|
||||
check(size == LanguageVersion.values().size) {
|
||||
|
||||
@@ -494,7 +494,7 @@ enum class LanguageVersion(val major: Int, val minor: Int) : DescriptionAware, L
|
||||
str.split(".", "-").let { if (it.size >= 2) fromVersionString("${it[0]}.${it[1]}") else null }
|
||||
|
||||
// Version status
|
||||
// 1.0..1.3 1.4..1.5 1.6..1.9 2.0
|
||||
// 1.0..1.3 1.4..1.6 1.7..2.0 2.1
|
||||
// Language: UNSUPPORTED --> DEPRECATED ------> STABLE ---> EXPERIMENTAL
|
||||
// API: UNSUPPORTED --> DEPRECATED ------> STABLE ---> EXPERIMENTAL
|
||||
|
||||
@@ -505,10 +505,10 @@ enum class LanguageVersion(val major: Int, val minor: Int) : DescriptionAware, L
|
||||
val FIRST_SUPPORTED = KOTLIN_1_4
|
||||
|
||||
@JvmField
|
||||
val FIRST_NON_DEPRECATED = KOTLIN_1_6
|
||||
val FIRST_NON_DEPRECATED = KOTLIN_1_7
|
||||
|
||||
@JvmField
|
||||
val LATEST_STABLE = KOTLIN_1_9
|
||||
val LATEST_STABLE = KOTLIN_2_0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean)
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val INSTANCE = JvmMetadataVersion(1, 9, 0)
|
||||
val INSTANCE = JvmMetadataVersion(2, 0, 0)
|
||||
|
||||
@JvmField
|
||||
val INSTANCE_NEXT = INSTANCE.next()
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=90000
|
||||
systemProp.org.gradle.internal.http.socketTimeout=90000
|
||||
|
||||
cacheRedirectorEnabled=true
|
||||
defaultSnapshotVersion=1.9.255-SNAPSHOT
|
||||
defaultSnapshotVersion=2.0.255-SNAPSHOT
|
||||
kotlinLanguageVersion=1.9
|
||||
|
||||
kotlin.build.gradlePlugin.version=0.0.39
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Kotlin</name>
|
||||
|
||||
@@ -79,5 +79,5 @@ public class KotlinVersion(val major: Int, val minor: Int, val patch: Int) : Com
|
||||
// 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, 9, 255) // value is written here automatically during build
|
||||
fun get(): KotlinVersion = KotlinVersion(2, 0, 255) // value is written here automatically during build
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-bom</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- No parent to avoid accidentally inheriting parent's dependencyManagement section -->
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ enum class KotlinVersion(val version: String) {
|
||||
@Deprecated("Unsupported", level = DeprecationLevel.ERROR) KOTLIN_1_3("1.3"),
|
||||
@Deprecated("Will be removed soon") KOTLIN_1_4("1.4"),
|
||||
@Deprecated("Will be removed soon") KOTLIN_1_5("1.5"),
|
||||
KOTLIN_1_6("1.6"),
|
||||
@Deprecated("Will be removed soon") KOTLIN_1_6("1.6"),
|
||||
KOTLIN_1_7("1.7"),
|
||||
KOTLIN_1_8("1.8"),
|
||||
KOTLIN_1_9("1.9"),
|
||||
@@ -25,6 +25,6 @@ enum class KotlinVersion(val version: String) {
|
||||
KotlinVersion.values().firstOrNull { it.version == version }
|
||||
?: throw IllegalArgumentException("Unknown Kotlin version: $version")
|
||||
|
||||
val DEFAULT = KOTLIN_1_9
|
||||
val DEFAULT = KOTLIN_2_0
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ interface KotlinCommonCompilerOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCo
|
||||
|
||||
/**
|
||||
* Allow using declarations only from the specified version of bundled libraries
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6 (deprecated)", "1.7", "1.8", "1.9", "2.0", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
@get:org.gradle.api.tasks.Optional
|
||||
@@ -18,7 +18,7 @@ interface KotlinCommonCompilerOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCo
|
||||
|
||||
/**
|
||||
* Provide source compatibility with the specified version of Kotlin
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6 (deprecated)", "1.7", "1.8", "1.9", "2.0", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
@get:org.gradle.api.tasks.Optional
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonTool
|
||||
|
||||
/**
|
||||
* Allow using declarations only from the specified version of bundled libraries
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6 (deprecated)", "1.7", "1.8", "1.9", "2.0", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
var apiVersion: kotlin.String?
|
||||
@@ -27,7 +27,7 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonTool
|
||||
|
||||
/**
|
||||
* Provide source compatibility with the specified version of Kotlin
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6 (deprecated)", "1.7", "1.8", "1.9", "2.0", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
var languageVersion: kotlin.String?
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
publishing_version = 1.0-5.3-1.9.255-SNAPSHOT
|
||||
publishing_version = 1.0-5.3-2.0.255-SNAPSHOT
|
||||
|
||||
+2
-2
@@ -52,9 +52,9 @@ class MetricPolicyTest {
|
||||
assertEquals("1.2.3", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.2.3-unknown suffix"))
|
||||
|
||||
assertEquals("123.234.345-dev", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("123.234.345-dev-12345"))
|
||||
assertEquals("1.9.255-snapshot", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.9.255-SNAPSHOT"))
|
||||
assertEquals("2.0.255-snapshot", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("2.0.255-SNAPSHOT"))
|
||||
|
||||
assertEquals("1.9.255-beta", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.9.255-beta"))
|
||||
assertEquals("2.0.255-beta", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("2.0.255-beta"))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@ class DeserializeStringTest {
|
||||
"buildSystem": "Gradle",
|
||||
"buildSystemVersion": "6.7",
|
||||
"buildPlugin": "org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper",
|
||||
"buildPluginVersion": "1.9.255-SNAPSHOT",
|
||||
"buildPluginVersion": "2.0.255-SNAPSHOT",
|
||||
"projectSettings": {
|
||||
"isHmppEnabled": false,
|
||||
"isCompatibilityMetadataVariantEnabled": true
|
||||
@@ -78,7 +78,7 @@ class DeserializeStringTest {
|
||||
assertEquals("Gradle", metadata.buildSystem)
|
||||
assertEquals("6.7", metadata.buildSystemVersion)
|
||||
assertEquals("org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper", metadata.buildPlugin)
|
||||
assertEquals("1.9.255-SNAPSHOT", metadata.buildPluginVersion)
|
||||
assertEquals("2.0.255-SNAPSHOT", metadata.buildPluginVersion)
|
||||
assertFalse(metadata.projectSettings.isHmppEnabled)
|
||||
assertTrue(metadata.projectSettings.isCompatibilityMetadataVariantEnabled)
|
||||
assertFalse(metadata.projectSettings.isKPMEnabled)
|
||||
@@ -134,7 +134,7 @@ class DeserializeStringTest {
|
||||
"buildSystem": "Gradle",
|
||||
"buildSystemVersion": "7.1",
|
||||
"buildPlugin": "org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper",
|
||||
"buildPluginVersion": "1.9.255-SNAPSHOT",
|
||||
"buildPluginVersion": "2.0.255-SNAPSHOT",
|
||||
"projectSettings": {
|
||||
"isHmppEnabled": false,
|
||||
"isCompatibilityMetadataVariantEnabled": true,
|
||||
@@ -191,7 +191,7 @@ class DeserializeStringTest {
|
||||
assertEquals("Gradle", metadata.buildSystem)
|
||||
assertEquals("7.1", metadata.buildSystemVersion)
|
||||
assertEquals("org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper", metadata.buildPlugin)
|
||||
assertEquals("1.9.255-SNAPSHOT", metadata.buildPluginVersion)
|
||||
assertEquals("2.0.255-SNAPSHOT", metadata.buildPluginVersion)
|
||||
assertFalse(metadata.projectSettings.isHmppEnabled)
|
||||
assertTrue(metadata.projectSettings.isCompatibilityMetadataVariantEnabled)
|
||||
assertTrue(metadata.projectSettings.isKPMEnabled)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-archetypes-parent</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-archetypes-parent</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-project</artifactId>
|
||||
<version>1.9.255-SNAPSHOT</version>
|
||||
<version>2.0.255-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import org.gradle.api.Project
|
||||
*
|
||||
* e.g. if a developer set's
|
||||
*
|
||||
* `defaultSnapshotVersion.kotlin_build.expected_value=1.6.255-SNAPSHOT` and the value gets bumped to `1.9.255-SNAPSHOT` after pulling from master,
|
||||
* `defaultSnapshotVersion.kotlin_build.expected_value=1.6.255-SNAPSHOT` and the value gets bumped to `2.0.255-SNAPSHOT` after pulling from master,
|
||||
* the developer will notice this during project configuration phase.
|
||||
*/
|
||||
fun Project.checkExpectedGradlePropertyValues() {
|
||||
|
||||
Reference in New Issue
Block a user