Skip to content

Commit

Permalink
improve handling of BCV and atomicfu plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed May 15, 2024
1 parent f39127d commit a79093c
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 27 deletions.
2 changes: 2 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ plugins {

dependencies {
implementation(libs.kotlin.gradle.plugin)
implementation(libs.kotlinx.bcv.gradle.plugin)
implementation(libs.kotlinx.atomicfu.gradle.plugin)
}
20 changes: 20 additions & 0 deletions build-logic/src/main/kotlin/rsocketbuild.atomicfu.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2015-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// this convention plugin will be not needed after https://github.com/Kotlin/kotlinx-atomicfu/issues/56
plugins {
id("kotlinx-atomicfu")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
plugins {
id("rsocketbuild.multiplatform-base")
id("rsocketbuild.publication")
id("org.jetbrains.kotlinx.binary-compatibility-validator")
}

kotlin {
Expand Down
21 changes: 1 addition & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,8 @@

import org.jetbrains.kotlin.gradle.targets.js.yarn.*

buildscript {
dependencies {
// kotlinx.atomicfu should be on classpath
// it's an implementation detail of kotlinx.atomicfu gradle plugin
classpath(libs.kotlin.gradle.plugin)
classpath(libs.kotlinx.atomicfu.gradle.plugin)
}
}

plugins {
// for now BCV uses `allProjects` internally, so we can't apply it just to specific subprojects
alias(libs.plugins.kotlinx.bcv)
}

apiValidation {
ignoredProjects.addAll(
listOf(
"rsocket-test",
"rsocket-transport-tests"
)
)
alias(libs.plugins.kotlin.multiplatform) apply false
}

plugins.withType<YarnPlugin> {
Expand Down
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ rsocket-java-transport-local = { module = 'io.rsocket:rsocket-transport-local',

kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-atomicfu-gradle-plugin = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "kotlinx-atomicfu" }
kotlinx-bcv-gradle-plugin = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "kotlinx-bcv" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }


kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }
kotlinx-bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-bcv" }
2 changes: 1 addition & 1 deletion rsocket-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import rsocketbuild.*

plugins {
id("rsocketbuild.multiplatform-library")
id("kotlinx-atomicfu")
id("rsocketbuild.atomicfu")
}

description = "rsocket-kotlin core functionality"
Expand Down
2 changes: 1 addition & 1 deletion rsocket-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import rsocketbuild.*

plugins {
id("rsocketbuild.multiplatform-base")
id("kotlinx-atomicfu")
id("rsocketbuild.atomicfu")
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand Down
2 changes: 1 addition & 1 deletion rsocket-transport-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import rsocketbuild.*

plugins {
id("rsocketbuild.multiplatform-base")
id("kotlinx-atomicfu")
id("rsocketbuild.atomicfu")
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand Down
2 changes: 1 addition & 1 deletion rsocket-transports/local/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import rsocketbuild.*

plugins {
id("rsocketbuild.multiplatform-library")
id("kotlinx-atomicfu")
id("rsocketbuild.atomicfu")
}

description = "rsocket-kotlin Local transport implementation"
Expand Down

0 comments on commit a79093c

Please sign in to comment.