Skip to content

Commit

Permalink
Update to Gradle 8 (Kotlin#3966)
Browse files Browse the repository at this point in the history
* Update Gradle to 8.5 and all the Gradle plugins where required
* Migrate away from deprecated Gradle API
* Migrate to jvmToolchain, use 11 as the main one
* Apply workarounds for new Gradle constraints, mostly related to implicit dependencies
* Fix a race in CoroutineScheduler.shutdown (exposed by toolchain update):
    * If the thread is in 'NEW' state, then 'isAlive: false' and 'join' returns immediately, meaning that there is a race between thread start and shutdown sequence that makes post-join assertion sporadically fail
* Restructure our build scripts to use .kts conventions only
* Get rid of the deprecated KGP target preset API
* Use the default source-set hierarchy for MPP

---------

Co-authored-by: Dmitry Khalanskiy <[email protected]>
  • Loading branch information
qwwdfsad and dkhalanskyjb committed Dec 21, 2023
1 parent 7bb0638 commit d12eb45
Show file tree
Hide file tree
Showing 57 changed files with 1,217 additions and 1,314 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,13 @@ commonMain {
}
```

No more additional dependencies are needed, platform-specific artifacts will be resolved automatically via Gradle metadata available since Gradle 5.3.

Platform-specific dependencies are recommended to be used only for non-multiplatform projects that are compiled only for target platform.

#### JS

Kotlin/JS version of `kotlinx.coroutines` is published as
[`kotlinx-coroutines-core-js`](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.8.0-RC)
(follow the link to get the dependency declaration snippet) and as [`kotlinx-coroutines-core`](https://www.npmjs.com/package/kotlinx-coroutines-core) NPM package.
(follow the link to get the dependency declaration snippet).

#### Native

Expand Down
18 changes: 9 additions & 9 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2016-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

import me.champeau.jmh.*
import org.jetbrains.kotlin.gradle.tasks.*
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.github.johnrengelman.shadow")
Expand All @@ -22,18 +22,18 @@ java {
}

tasks.named<KotlinCompile>("compileJmhKotlin") {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xjvm-default=all"
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
freeCompilerArgs.add("-Xjvm-default=all")
}
}

val jmhJarTask = tasks.named<Jar>("jmhJar") {
archiveBaseName by "benchmarks"
archiveClassifier by null
archiveVersion by null
archiveBaseName = "benchmarks"
archiveClassifier = null
archiveVersion = null
archiveVersion.convention(null as String?)
destinationDirectory.set(file("$rootDir"))
destinationDirectory = rootDir
}

tasks {
Expand Down
Loading

0 comments on commit d12eb45

Please sign in to comment.