Switch kotlin version to 1.9

with appropriate fixes in testdata, tests and other
places.
This commit is contained in:
Dmitriy Novozhilov
2022-11-21 18:01:37 +02:00
committed by Space Team
parent e2403c801f
commit 66544a4e00
29 changed files with 44 additions and 44 deletions
@@ -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.8.255-SNAPSHOT` after pulling from master,
* `defaultSnapshotVersion.kotlin_build.expected_value=1.6.255-SNAPSHOT` and the value gets bumped to `1.9.255-SNAPSHOT` after pulling from master,
* the developer will notice this during project configuration phase.
*/
fun Project.checkExpectedGradlePropertyValues() {
@@ -23,8 +23,8 @@ private val LANGUAGE_TO_METADATA_VERSION = EnumMap<LanguageVersion, JvmMetadataV
this[LanguageVersion.KOTLIN_1_5] = JvmMetadataVersion(1, 5, 1)
this[LanguageVersion.KOTLIN_1_6] = JvmMetadataVersion(1, 6, 0)
this[LanguageVersion.KOTLIN_1_7] = JvmMetadataVersion(1, 7, 0)
this[LanguageVersion.KOTLIN_1_8] = JvmMetadataVersion.INSTANCE
this[LanguageVersion.KOTLIN_1_9] = JvmMetadataVersion(1, 9, 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)
check(size == LanguageVersion.values().size) {
@@ -448,21 +448,21 @@ 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.1 1.2 1.3 1.4 1.5..1.8 1.9
// 1.0..1.3 1.4..1.5 1.6..1.9 2.0
// Language: UNSUPPORTED --> DEPRECATED ------> STABLE ---> EXPERIMENTAL
// API: UNSUPPORTED --> DEPRECATED ------> STABLE ---> EXPERIMENTAL
@JvmField
val FIRST_API_SUPPORTED = KOTLIN_1_3
val FIRST_API_SUPPORTED = KOTLIN_1_4
@JvmField
val FIRST_SUPPORTED = KOTLIN_1_3
val FIRST_SUPPORTED = KOTLIN_1_4
@JvmField
val FIRST_NON_DEPRECATED = KOTLIN_1_5
val FIRST_NON_DEPRECATED = KOTLIN_1_6
@JvmField
val LATEST_STABLE = KOTLIN_1_8
val LATEST_STABLE = KOTLIN_1_9
}
}
@@ -56,7 +56,7 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean)
companion object {
@JvmField
val INSTANCE = JvmMetadataVersion(1, 8, 0)
val INSTANCE = JvmMetadataVersion(1, 9, 0)
@JvmField
val INSTANCE_NEXT = INSTANCE.next()
+1 -1
View File
@@ -27,7 +27,7 @@ systemProp.org.gradle.internal.http.socketTimeout=90000
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
cacheRedirectorEnabled=true
defaultSnapshotVersion=1.8.255-SNAPSHOT
defaultSnapshotVersion=1.9.255-SNAPSHOT
kotlin.build.gradlePlugin.version=0.0.39
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.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, 8, 255) // value is written here automatically during build
}
fun get(): KotlinVersion = KotlinVersion(1, 9, 255) // value is written here automatically during build
}
@@ -15,7 +15,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-bom</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.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.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -9,9 +9,9 @@ enum class KotlinVersion(val version: String) {
@Deprecated("Unsupported", level = DeprecationLevel.ERROR) KOTLIN_1_0("1.0"),
@Deprecated("Unsupported", level = DeprecationLevel.ERROR) KOTLIN_1_1("1.1"),
@Deprecated("Unsupported", level = DeprecationLevel.ERROR) KOTLIN_1_2("1.2"),
@Deprecated("Will be removed soon") KOTLIN_1_3("1.3"),
@Deprecated("Unsupported", level = DeprecationLevel.ERROR) KOTLIN_1_3("1.3"),
@Deprecated("Will be removed soon") KOTLIN_1_4("1.4"),
KOTLIN_1_5("1.5"),
@Deprecated("Will be removed soon") KOTLIN_1_5("1.5"),
KOTLIN_1_6("1.6"),
KOTLIN_1_7("1.7"),
KOTLIN_1_8("1.8"),
@@ -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.3 (deprecated)", "1.4 (deprecated)", "1.5", "1.6", "1.7", "1.8", "1.9 (experimental)", "2.0 (experimental)"
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (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.3 (deprecated)", "1.4 (deprecated)", "1.5", "1.6", "1.7", "1.8", "1.9 (experimental)", "2.0 (experimental)"
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
* Default value: null
*/
@get:org.gradle.api.tasks.Optional
@@ -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.3 (deprecated)", "1.4 (deprecated)", "1.5", "1.6", "1.7", "1.8", "1.9 (experimental)", "2.0 (experimental)"
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (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.3 (deprecated)", "1.4 (deprecated)", "1.5", "1.6", "1.7", "1.8", "1.9 (experimental)", "2.0 (experimental)"
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
* Default value: null
*/
var languageVersion: kotlin.String?
@@ -1 +1 @@
publishing_version = 1.0-5.3-1.8.255-SNAPSHOT
publishing_version = 1.0-5.3-1.9.255-SNAPSHOT
@@ -49,9 +49,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.8.255-snapshot", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.8.255-SNAPSHOT"))
assertEquals("1.9.255-snapshot", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.9.255-SNAPSHOT"))
assertEquals("1.8.255-beta", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.8.255-beta"))
assertEquals("1.9.255-beta", StringAnonymizationPolicy.ComponentVersionAnonymizer().anonymize("1.9.255-beta"))
}
@Test
@@ -71,4 +71,4 @@ class MetricPolicyTest {
whenAdded("AAA", "UNEXPECTED-VALUE${separator}common${separator}js${separator}jvm")
whenAdded("BBB", "UNEXPECTED-VALUE${separator}common${separator}js${separator}jvm")
}
}
}
+1 -1
View File
@@ -16,7 +16,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -16,7 +16,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -17,7 +17,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -5,7 +5,7 @@
<parent>
<artifactId>kotlin-project</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -17,7 +17,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -17,7 +17,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>kotlin-project</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -7,7 +7,7 @@ final String kotlinRootDir = rootProject.file("../../../").absolutePath.replace(
final String kotlinLibsDir = "$buildDir/libs"
final String githubRevision = isTeamcityBuild ? project.property("githubRevision") : "master"
final String kotlinVersion = isTeamcityBuild ? project.property("deployVersion") : "1.8.255-SNAPSHOT"
final String kotlinVersion = isTeamcityBuild ? project.property("deployVersion") : "1.9.255-SNAPSHOT"
final String repo = isTeamcityBuild ? project.property("kotlinLibsRepo") : "$kotlinRootDir/build/repo"
println("# Extracting info:")
@@ -95,4 +95,4 @@ project.extensions.uncommentSinceKotlinForNewEnums = {
}
file.write(String.join("\n", lines))
}
}
}
@@ -18,7 +18,7 @@ class DeserializeStringTest {
"buildSystem": "Gradle",
"buildSystemVersion": "6.7",
"buildPlugin": "org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper",
"buildPluginVersion": "1.8.255-SNAPSHOT",
"buildPluginVersion": "1.9.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.8.255-SNAPSHOT", metadata.buildPluginVersion)
assertEquals("1.9.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.8.255-SNAPSHOT",
"buildPluginVersion": "1.9.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.8.255-SNAPSHOT", metadata.buildPluginVersion)
assertEquals("1.9.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.8.255-SNAPSHOT</version>
<version>1.9.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.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.8.255-SNAPSHOT</version>
<version>1.9.255-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>