Skip to content

Commit

Permalink
Revert the name of the kotlinx-runtime-module in the resolution config
Browse files Browse the repository at this point in the history
WA for broken atomicfu compiler plugin dependency in kotlin 1.7.0
(See: Kotlin/kotlinx-atomicfu#232)
  • Loading branch information
mvicsokolova authored and woainikk committed Aug 15, 2022
1 parent f9f5c94 commit 7e7e444
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
17 changes: 16 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ apply(from = "gradle/compatibility.gradle")
plugins {
id("org.jetbrains.dokka") version "1.6.21" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.10.0"
id("kotlinx-atomicfu") version "0.18.0" apply false
id("kotlinx-atomicfu") version "0.18.2" apply false
}

val kotlinVersion = libs.versions.kotlin.version.get()
Expand Down Expand Up @@ -139,6 +139,21 @@ allprojects {
}
}

configurations.all {
resolutionStrategy.dependencySubstitution.all {
val requestedComponent = requested
if (requestedComponent is ModuleComponentSelector &&
requestedComponent.group == "org.jetbrains.kotlin" &&
requestedComponent.module == "atomicfu"
) {
useTarget(
"${requestedComponent.group}:kotlinx-atomicfu-runtime:$kotlinVersion",
"Using proper kotlinx-atomicfu-runtime instead of Gradle plugin"
)
}
}
}

kotlin {
targets.all {

Expand Down
10 changes: 8 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoole
repositories {
mavenCentral()
maven("https://plugins.gradle.org/m2")
maven("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")

maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
maven("https://plugins.gradle.org/m2")
mavenLocal()
if (buildSnapshotTrain) {
mavenLocal()
}
Expand All @@ -26,7 +29,10 @@ configurations.configureEach {
if (isCanBeResolved) {
attributes {
@Suppress("UnstableApiUsage")
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, project.objects.named(GradleVersion.current().version))
attribute(
GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE,
project.objects.named(GradleVersion.current().version)
)
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ pluginManagement {
repositories {
maven("https://plugins.gradle.org/m2")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
mavenCentral()
if (build_snapshot_train?.toBoolean() == true) {
mavenLocal()
}

maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-atomicfu/maven").credentials {
username = "margarita.bobova"
password =
"eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxcm1UZ20wbEFKaEoiLCJhdWQiOiJjaXJjbGV0LXdlYi11aSIsIm9yZ0RvbWFpbiI6InB1YmxpYyIsIm5hbWUiOiJtYXJnYXJpdGEuYm9ib3ZhIiwiaXNzIjoiaHR0cHM6XC9cL3B1YmxpYy5qZXRicmFpbnMuc3BhY2UiLCJwZXJtX3Rva2VuIjoiSVBwZlkwQ3M1cjUiLCJwcmluY2lwYWxfdHlwZSI6IlVTRVIiLCJpYXQiOjE2NDk5MjM2NDF9.olTvoKz6KSX1rMCkid3vCSvwy-95rQTYL9gVlj7ueudTEVGqXaq1tJc37FDnKL6i6oc26XLVDK0y4G_B7ZKJGoMh77nckx-XMmRxB4Q3LZY1cXo_Mt4zD9lPxfFAfHW9RboJFgNlLWzg3OVQvMwDgHetYhnuGmlTtzCKfCW3Ke4"
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ kotlin.daemon.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF
org.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:HeapDumpPath="./oom_dump.hprof"

# kotlin
kotlin_version=1.7.0
kotlin_version=1.7.10-322
kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
Expand All @@ -34,7 +34,7 @@ kotlin.mpp.enableCompatibilityMetadataVariant=true
# kotlin libraries
coroutines_version=1.6.3
serialization_version=1.3.3
atomicfu_version=0.18.0
atomicfu_version=0.18.2
validator_version=0.3.0
kotlinx_html_version=0.7.3
slf4j_version=1.7.36
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
kotlin-version = "1.7.0-RC"
kotlin-version = "1.7.0"
kotlinx-html-version = "0.7.5"
coroutines-version = "1.6.3"
atomicfu-version = "0.18.0"
atomicfu-version = "0.18.2"
serialization-version = "1.3.3"
validator-version = "0.8.0"
ktlint-version = "3.10.0"
Expand Down

0 comments on commit 7e7e444

Please sign in to comment.