From c3256d2352bca2de82be782233252a3a7c0f7e8d Mon Sep 17 00:00:00 2001 From: mvicsokolova <82594708+mvicsokolova@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:51:58 +0200 Subject: [PATCH] Fix the new ID of the atomicfu-gradle-plugin (#445) * To be published on GPP the gradle plugin should be namespaced and the plugin cannot be published with the old id `kotlinx-atomicfu` as it was before. So, the plugin name is changed to `org.jetbrains.kotlinx.atomicfu`. * Update instructions added to README --- README.md | 47 ++++++++++++++----- atomicfu-gradle-plugin/build.gradle.kts | 3 +- .../AtomicfuKotlinCompilerPluginInternal.kt | 2 +- .../jdk-compatibility/build.gradle.kts | 2 +- .../examples/jvm-sample/build.gradle.kts | 4 +- .../examples/mpp-sample/build.gradle.kts | 2 +- .../shared/build.gradle.kts | 2 +- .../producer/build.gradle.kts | 2 +- .../examples/plugin-order-bug/build.gradle | 2 +- 9 files changed, 45 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 96de1e75..640d4104 100644 --- a/README.md +++ b/README.md @@ -112,28 +112,53 @@ operations. They can be also atomically modified via `+=` and `-=` operators. ### Apply plugin #### Gradle configuration -In top-level build file: +> **New plugin id:** Please pay attention, that starting from version `0.25.0` the plugin id is `org.jetbrains.kotlinx.atomicfu` + +Add the following to your top-level build file: + +
+Kotlin + +```kotlin +plugins { + id("org.jetbrains.kotlinx.atomicfu") version "0.25.0" +} +``` +
+ +
+Groovy + +```groovy +plugins { + id 'org.jetbrains.kotlinx.atomicfu' version '0.25.0' +} +``` +
+ + +#### Legacy plugin application
-Kotlin DSL +Kotlin ```kotlin buildscript { - repositories { - mavenCentral() - } + repositories { + mavenCentral() + } - dependencies { - classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.24.0") - } + dependencies { + classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.24.0") + } } -apply(plugin = "kotlinx-atomicfu") +apply(plugin = "org.jetbrains.kotlinx.atomicfu") ```
-Groovy DSL +Groovy ```groovy buildscript { @@ -145,7 +170,7 @@ buildscript { } } -apply plugin: 'kotlinx-atomicfu' +apply plugin: 'org.jetbrains.kotlinx.atomicfu' ```
diff --git a/atomicfu-gradle-plugin/build.gradle.kts b/atomicfu-gradle-plugin/build.gradle.kts index 19426021..02e4c6db 100644 --- a/atomicfu-gradle-plugin/build.gradle.kts +++ b/atomicfu-gradle-plugin/build.gradle.kts @@ -53,10 +53,11 @@ gradlePlugin { plugins { create("Atomicfu") { - id = "kotlinx-atomicfu" + id = "org.jetbrains.kotlinx.atomicfu" implementationClass = "kotlinx.atomicfu.plugin.gradle.AtomicFUGradlePlugin" displayName = "Gradle plugin for kotlinx-atomicfu library" description = "Enables efficient use of atomic operations in Kotlin multiplatform projects." + tags = setOf("kotlinx-atomicfu", "atomics", "kotlin") } } } diff --git a/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicfuKotlinCompilerPluginInternal.kt b/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicfuKotlinCompilerPluginInternal.kt index 1ceb29ad..178b7c98 100644 --- a/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicfuKotlinCompilerPluginInternal.kt +++ b/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicfuKotlinCompilerPluginInternal.kt @@ -33,7 +33,7 @@ internal class AtomicfuKotlinCompilerPluginInternal : KotlinCompilerPluginSuppor kotlinCompilation: KotlinCompilation<*> ): Provider> = kotlinCompilation.target.project.provider { emptyList() } - override fun getCompilerPluginId() = "org.jetbrains.kotlinx.atomicfu" + override fun getCompilerPluginId() = "org.jetbrains.kotlin.atomicfu" // Gets "org.jetbrains.kotlin:kotlin-atomicfu-compiler-plugin-embeddable:{KGP version}" override fun getPluginArtifact(): SubpluginArtifact { diff --git a/integration-testing/examples/jdk-compatibility/build.gradle.kts b/integration-testing/examples/jdk-compatibility/build.gradle.kts index 611a8a8a..ea90481b 100644 --- a/integration-testing/examples/jdk-compatibility/build.gradle.kts +++ b/integration-testing/examples/jdk-compatibility/build.gradle.kts @@ -5,7 +5,7 @@ version = "DUMMY_VERSION" plugins { kotlin("jvm") version libs.versions.kotlinVersion.get() - id("kotlinx-atomicfu") version libs.versions.atomicfuVersion.get() + id("org.jetbrains.kotlinx.atomicfu") version libs.versions.atomicfuVersion.get() `maven-publish` } diff --git a/integration-testing/examples/jvm-sample/build.gradle.kts b/integration-testing/examples/jvm-sample/build.gradle.kts index d514dc73..32f75ae8 100644 --- a/integration-testing/examples/jvm-sample/build.gradle.kts +++ b/integration-testing/examples/jvm-sample/build.gradle.kts @@ -4,12 +4,10 @@ version = "DUMMY_VERSION" plugins { application kotlin("jvm") version libs.versions.kotlinVersion.get() - id("kotlinx-atomicfu") version libs.versions.atomicfuVersion.get() + id("org.jetbrains.kotlinx.atomicfu") version libs.versions.atomicfuVersion.get() `maven-publish` } -apply(plugin = "kotlinx-atomicfu") - repositories { mavenCentral() maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") diff --git a/integration-testing/examples/mpp-sample/build.gradle.kts b/integration-testing/examples/mpp-sample/build.gradle.kts index ab1b2353..e51c1b40 100644 --- a/integration-testing/examples/mpp-sample/build.gradle.kts +++ b/integration-testing/examples/mpp-sample/build.gradle.kts @@ -10,7 +10,7 @@ version = "DUMMY_VERSION" plugins { kotlin("multiplatform") version libs.versions.kotlinVersion.get() `maven-publish` - id("kotlinx-atomicfu") version libs.versions.atomicfuVersion.get() + id("org.jetbrains.kotlinx.atomicfu") version libs.versions.atomicfuVersion.get() } repositories { diff --git a/integration-testing/examples/mpp-version-catalog/shared/build.gradle.kts b/integration-testing/examples/mpp-version-catalog/shared/build.gradle.kts index 7a575575..4d69670a 100644 --- a/integration-testing/examples/mpp-version-catalog/shared/build.gradle.kts +++ b/integration-testing/examples/mpp-version-catalog/shared/build.gradle.kts @@ -12,7 +12,7 @@ repositories { plugins { alias(libs.plugins.kotlinMultiplatform) - id("kotlinx-atomicfu") version libs.versions.atomicfu.get() + id("org.jetbrains.kotlinx.atomicfu") version libs.versions.atomicfu.get() } kotlin { diff --git a/integration-testing/examples/multi-module-test/producer/build.gradle.kts b/integration-testing/examples/multi-module-test/producer/build.gradle.kts index abba904d..09171dc8 100644 --- a/integration-testing/examples/multi-module-test/producer/build.gradle.kts +++ b/integration-testing/examples/multi-module-test/producer/build.gradle.kts @@ -1,6 +1,6 @@ plugins { kotlin("multiplatform") version libs.versions.kotlinVersion.get() - id("kotlinx-atomicfu") version libs.versions.atomicfuVersion.get() + id("org.jetbrains.kotlinx.atomicfu") version libs.versions.atomicfuVersion.get() } repositories { diff --git a/integration-testing/examples/plugin-order-bug/build.gradle b/integration-testing/examples/plugin-order-bug/build.gradle index 27a7ef28..4e6bdea3 100644 --- a/integration-testing/examples/plugin-order-bug/build.gradle +++ b/integration-testing/examples/plugin-order-bug/build.gradle @@ -17,7 +17,7 @@ buildscript { } // Apply KGP via buildscript to check this issue: #384 apply plugin: 'org.jetbrains.kotlin.multiplatform' -apply plugin: 'kotlinx-atomicfu' +apply plugin: 'org.jetbrains.kotlinx.atomicfu' repositories { mavenCentral()