Skip to content

Commit

Permalink
Update Kotlin compiler and KGP to 1.9.20-RC2 (#3262)
Browse files Browse the repository at this point in the history
* Update Kotlin compiler to 1.9.20-RC2

The current changes are related to JetBrains/kotlin@d797505

* Update KGP to 1.9.20-RC2

* Replace common stdlib in unit tests

* Update Kotlin version in integration tests

* Fix `Multiplatform0GradleIntegrationTest`

* Turn WasmGradleIntegrationTest off for Kotlin 1.9.20-RC2
  • Loading branch information
vmishenev authored Nov 1, 2023
1 parent 7951aff commit 2b0a63f
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 24 deletions.
11 changes: 5 additions & 6 deletions core/test-api/src/main/kotlin/testApi/testRunner/TestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,11 @@ public abstract class AbstractTest<M : TestMethods, T : TestBuilder<M>, D : Dokk
?.replaceAfter(".jar", "")
}

protected val commonStdlibPath: String? by lazy {
// TODO: feels hacky, find a better way to do it
ClassLoader.getSystemResource("kotlin/UInt.kotlin_metadata")
?.file
?.replace("file:", "")
?.replaceAfter(".jar", "")
protected val commonStdlibPath: String? by lazy {
// `kotlin-stdlib-common` is legacy
// we can use any platform dependency
// since common code should be resolved with all platform
jvmStdlibPath
}

protected val stdlibExternalDocumentationLink: ExternalDocumentationLinkImpl = ExternalDocumentationLinkImpl(
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]

gradlePlugin-kotlin = "1.9.10"
gradlePlugin-kotlin = "1.9.20-RC2"
# See: https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
gradlePlugin-android = "4.2.2"
gradlePlugin-dokka = "1.9.10"
Expand All @@ -10,7 +10,7 @@ kotlinx-collections-immutable = "0.3.6"
kotlinx-bcv = "0.13.2"

## Analysis
kotlin-compiler = "1.9.10"
kotlin-compiler = "1.9.20-RC2"
kotlin-compiler-k2 = "2.0.0-dev-5387"

# MUST match the version of the intellij platform used in the kotlin compiler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kotlin {
jvm()
linuxX64("linux")
macosX64("macos")
js(BOTH)
js(IR) // Starting with Kotlin 1.9.0, using compiler types LEGACY or BOTH leads to an error.
//TODO Add wasm when kx.coroutines will be supported and published into the main repo
sourceSets {
val commonMain by sourceSets.getting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
#

dokka_it_kotlin_version=1.9.10
#these flags are enabled by default since 1.6.20.
#remove when this test is executed with Kotlin >= 1.6.20
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ class Multiplatform0GradleIntegrationTest : AbstractGradleIntegrationTest() {
@ParameterizedTest(name = "{0}")
@ArgumentsSource(AllSupportedTestedVersionsArgumentsProvider::class)
fun execute(buildVersions: BuildVersions) {
val result = createGradleRunner(buildVersions, "dokkaHtml", "-i", "-s").buildRelaxed()
// `enableGranularSourceSetsMetadata` and `enableDependencyPropagation` flags are enabled by default since 1.6.20.
// remove when this test is executed with Kotlin >= 1.6.20
val result = if (buildVersions.kotlinVersion < "1.6.20")
createGradleRunner(
buildVersions,
"dokkaHtml",
"-i",
"-s",
"-Pkotlin.mpp.enableGranularSourceSetsMetadata=true",
"-Pkotlin.native.enableDependencyPropagation=false"
).buildRelaxed()
else
createGradleRunner(buildVersions, "dokkaHtml", "-i", "-s").buildRelaxed()

assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaHtml")).outcome)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal open class AllSupportedTestedVersionsArgumentsProvider : TestedVersions

internal object TestedVersions {

val LATEST = BuildVersions("7.6.2", "1.9.10")
val LATEST = BuildVersions("7.6.2", "1.9.20-RC2")

/**
* All supported Gradle/Kotlin versions, including [LATEST]
Expand All @@ -24,7 +24,7 @@ internal object TestedVersions {
val ALL_SUPPORTED =
BuildVersions.permutations(
gradleVersions = listOf("7.6.2"),
kotlinVersions = listOf("1.9.0", "1.8.20", "1.7.20", "1.6.21", "1.5.31"),
kotlinVersions = listOf("1.9.10", "1.8.20", "1.7.20", "1.6.21", "1.5.31"),
) + BuildVersions.permutations(
gradleVersions = listOf(*ifExhaustive("7.0", "6.1.1")),
kotlinVersions = listOf(*ifExhaustive( "1.8.0", "1.7.0", "1.6.0", "1.5.0"))
Expand Down Expand Up @@ -61,6 +61,7 @@ internal object TestedVersions {
"1.8.20" to "18.2.0-pre.546",
"1.9.0" to "18.2.0-pre.597",
"1.9.10" to "18.2.0-pre.597",
"1.9.20-RC2" to "18.2.0-pre.635",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal class WasmTestedVersionsArgumentsProvider : AllSupportedTestedVersionsA
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> {
return super.provideArguments(context).filter {
val buildVersions = it.get().single() as BuildVersions
buildVersions.kotlinVersion >= "1.8.20" // 1.8.20 is the first public version that can be tested with wasm
buildVersions.kotlinVersion >= "1.8.20" && // 1.8.20 is the first public version that can be tested with wasm
buildVersions.kotlinVersion <= "1.9.10"// in 1.9.20 wasm target was split into `wasm-js` and `wasm-wasi`
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/maven/projects/it-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<version>1.0-SNAPSHOT</version>

<properties>
<kotlin.version>1.9.10</kotlin.version>
<kotlin.version>1.9.20-RC</kotlin.version>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ internal class DokkaJsResolverForModuleFactory(
metadataFactories.DefaultDescriptorFactory,
metadataFactories.DefaultPackageFragmentsFactory,
metadataFactories.flexibleTypeDeserializer,
metadataFactories.platformDependentTypeTransformer
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.jetbrains.kotlin.library.metadata.DeserializedKlibModuleOrigin
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.library.metadata.KlibMetadataFactories
import org.jetbrains.kotlin.library.KotlinLibrary
import org.jetbrains.kotlin.library.metadata.NativeTypeTransformer
import org.jetbrains.kotlin.library.metadata.NullFlexibleTypeDeserializer
import org.jetbrains.kotlin.library.metadata.parseModuleHeader
import org.jetbrains.kotlin.name.Name
Expand Down Expand Up @@ -107,8 +106,7 @@ internal class DokkaKlibMetadataCommonDependencyContainer(
KlibMetadataModuleDescriptorFactoryImpl(
MetadataFactories.DefaultDescriptorFactory,
MetadataFactories.DefaultPackageFragmentsFactory,
MetadataFactories.flexibleTypeDeserializer,
MetadataFactories.platformDependentTypeTransformer
MetadataFactories.flexibleTypeDeserializer
)
}

Expand Down Expand Up @@ -138,6 +136,5 @@ internal class DokkaKlibMetadataCommonDependencyContainer(
private val MetadataFactories =
KlibMetadataFactories(
{ DefaultBuiltIns.Instance },
NullFlexibleTypeDeserializer,
NativeTypeTransformer()
NullFlexibleTypeDeserializer
)

0 comments on commit 2b0a63f

Please sign in to comment.