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 34956c6 commit 1d1fc3a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 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 @@ -138,6 +138,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

0 comments on commit 1d1fc3a

Please sign in to comment.