File tree Expand file tree Collapse file tree
librarian-core/src/main/kotlin/com/gradleup/librarian/core/tooling
kgp-240/kotlin/com/gradleup/librarian/internal
main/kotlin/com/gradleup/librarian/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ jsonpath = "com.eygraber:jsonpathkt-kotlinx:3.0.2"
2222jsonpathkt = " com.eygraber:jsonpathkt-kotlinx:3.0.2"
2323kgp220 = " org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0"
2424kgp2320 = " org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.20"
25+ kgp240 = " org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.0-Beta2"
2526kotlin-gradle-plugin = { module = " org.jetbrains.kotlin:kotlin-gradle-plugin" , version.ref = " kgp" }
2627ksp-gradle-plugin = " com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.3.3"
2728librarian-gradle-plugin = " com.gradleup.librarian:librarian-gradle-plugin:0.2.2-SNAPSHOT-c2127df7d03b2946fc025bf67d31cac3e2c5a397"
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ class PreRelease(
77
88/* *
99 *
10- * A variation of the traditional semantic versioning specification to support `-SNAPSHOT` and prerelease versions.
10+ * A variation of the traditional semantic versioning specification to support `-SNAPSHOT` and prerelease versions like:
11+ *
12+ * - 1.0.0
13+ * - 1.0.0-SNAPSHOT
14+ * - 1.0.0-rc.0
15+ * - 1.0.0.rc-0-SNAPSHOT
1116 *
1217 * ```
1318 * <valid semver> ::= <version core>
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ val mainCompilation = kotlin.target.compilations.getByName("main")
5050
5151mapOf (
5252 " 220" to setOf (libs.kgp220),
53- " 2320" to setOf (libs.kgp2320)
53+ " 2320" to setOf (libs.kgp2320),
54+ " 240" to setOf (libs.kgp240)
5455).forEach {
5556 val compilation = kotlin.target.compilations.create(" kgp-${it.key} " )
5657
Original file line number Diff line number Diff line change 1+ @file:OptIn(ExperimentalAbiValidation ::class )
2+
3+ package com.gradleup.librarian.internal
4+
5+ import org.gradle.api.Project
6+ import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
7+ import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
8+
9+ fun Project.configureBcv240 (
10+ excludePatterns : List <String > = emptyList(),
11+ ) {
12+ extensions.getByType(KotlinProjectExtension ::class .java).apply {
13+ abiValidation {
14+ it.filters {
15+ it.exclude.byNames.addAll(excludePatterns)
16+ }
17+ }
18+
19+ /* *
20+ * Compatibility tasks to not break the brain muscle
21+ */
22+ tasks.register(" apiDump" ) {
23+ it.dependsOn(" updateKotlinAbi" )
24+ it.doLast {
25+ println (" `apiDump` is deprecated. Use `updateKotlinAbi` instead" )
26+ }
27+ }
28+ tasks.register(" apiCheck" ) {
29+ it.dependsOn(" checkKotlinAbi" )
30+ it.doLast {
31+ println (" `apiCheck` is deprecated. Use `updateKotlinAbi` instead" )
32+ }
33+ }
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package com.gradleup.librarian.gradle
55import com.gradleup.librarian.core.tooling.semVerOrThrow
66import com.gradleup.librarian.internal.configureBcv220
77import com.gradleup.librarian.internal.configureBcv2320
8+ import com.gradleup.librarian.internal.configureBcv240
89import org.gradle.api.Project
910import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
1011import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
@@ -14,11 +15,12 @@ fun Project.configureBcv(
1415 excludePatterns : List <String > = emptyList(),
1516) {
1617 // See https://kotlinlang.org/docs/whatsnew2320.html#improvements-to-binary-compatibility-validation-in-kgp
17- val kgpVersion = this @configureBcv.getKotlinPluginVersion().semVerOrThrow()
18+ val kgpVersion = this @configureBcv.getKotlinPluginVersion()
1819
1920 when {
20- kgpVersion >= " 2.3.20" .semVerOrThrow() -> configureBcv2320(excludePatterns)
21- kgpVersion >= " 2.2.0" .semVerOrThrow() -> configureBcv220(excludePatterns)
21+ kgpVersion >= " 2.4.0" -> configureBcv240(excludePatterns)
22+ kgpVersion >= " 2.3.20" -> configureBcv2320(excludePatterns)
23+ kgpVersion >= " 2.2.0" -> configureBcv220(excludePatterns)
2224 else -> {
2325 if (warnIfMissing) {
2426 println (" Librarian: BCV is only configured by default if using KGP 2.2+ (currently detected is '${getKotlinPluginVersion()} '). Set bcv.warn=false in your librarian.root.properties file to remove this warning." )
You can’t perform that action at this time.
0 commit comments