Skip to content

Commit 5fa768d

Browse files
committed
update bcv to 0.14.0
1 parent 101ce0a commit 5fa768d

File tree

5 files changed

+40
-8
lines changed

5 files changed

+40
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ or (**experimentally**) [as a Settings plugin](#settings-plugin) in `settings.gr
3434

3535
The minimal supported Gradle version is 7.6.
3636

37-
By default, BCV-MU uses BCV version `0.13.2`, which can be overridden, but may introduce runtime
37+
By default, BCV-MU uses BCV version `0.14.0`, which can be overridden, but may introduce runtime
3838
errors.
3939

4040
### Build plugin
@@ -100,7 +100,7 @@ binaryCompatibilityValidator {
100100
bcvEnabled.set(true)
101101

102102
// Override the default BCV version
103-
kotlinxBinaryCompatibilityValidatorVersion.set("0.13.2")
103+
kotlinxBinaryCompatibilityValidatorVersion.set("0.14.0")
104104
}
105105
```
106106

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kotlinGradle = "1.9.22"
55
javaDiffUtils = "4.12"
66
junit = "5.10.1"
77
kotest = "5.8.0"
8-
kotlinx-bcv = "0.13.2"
8+
kotlinx-bcv = "0.14.0"
99

1010
gradlePluginPublishPlugin = "1.2.1"
1111
shadowPlugin = "8.1.1"

modules/bcv-gradle-plugin/build.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,35 @@ publishing {
130130
}
131131
}
132132
}
133+
134+
val createBCVProperties by tasks.registering {
135+
val bcvVersion = libs.versions.kotlinx.bcv
136+
inputs.property("bcvVersion", bcvVersion)
137+
138+
val generatedSource = layout.buildDirectory.dir("generated-src/main/kotlin/")
139+
outputs.dir(generatedSource)
140+
.withPropertyName("generatedSource")
141+
142+
doLast {
143+
val bcvMuBuildPropertiesFile = generatedSource.get()
144+
.file("dev/adamko/kotlin/binary_compatibility_validator/internal/BCVProperties.kt")
145+
146+
bcvMuBuildPropertiesFile.asFile.apply {
147+
parentFile.mkdirs()
148+
writeText(
149+
"""
150+
|package dev.adamko.kotlin.binary_compatibility_validator.internal
151+
|
152+
|internal object BCVProperties {
153+
| const val bcvVersion: String = "${bcvVersion.get()}"
154+
|}
155+
|
156+
""".trimMargin()
157+
)
158+
}
159+
}
160+
}
161+
162+
kotlin.sourceSets.main {
163+
kotlin.srcDir(createBCVProperties)
164+
}

modules/bcv-gradle-plugin/src/main/kotlin/BCVProjectPlugin.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import dev.adamko.kotlin.binary_compatibility_validator.BCVPlugin.Companion.API_
77
import dev.adamko.kotlin.binary_compatibility_validator.BCVPlugin.Companion.EXTENSION_NAME
88
import dev.adamko.kotlin.binary_compatibility_validator.BCVPlugin.Companion.RUNTIME_CLASSPATH_CONFIGURATION_NAME
99
import dev.adamko.kotlin.binary_compatibility_validator.BCVPlugin.Companion.RUNTIME_CLASSPATH_RESOLVER_CONFIGURATION_NAME
10-
import dev.adamko.kotlin.binary_compatibility_validator.internal.BCVInternalApi
11-
import dev.adamko.kotlin.binary_compatibility_validator.internal.declarable
12-
import dev.adamko.kotlin.binary_compatibility_validator.internal.resolvable
13-
import dev.adamko.kotlin.binary_compatibility_validator.internal.sourceSets
10+
import dev.adamko.kotlin.binary_compatibility_validator.internal.*
1411
import dev.adamko.kotlin.binary_compatibility_validator.tasks.BCVApiCheckTask
1512
import dev.adamko.kotlin.binary_compatibility_validator.tasks.BCVApiDumpTask
1613
import dev.adamko.kotlin.binary_compatibility_validator.tasks.BCVApiGenerateTask
@@ -97,7 +94,7 @@ constructor(
9794
enabled.convention(true)
9895
outputApiDir.convention(layout.projectDirectory.dir(API_DIR))
9996
projectName.convention(providers.provider { project.name })
100-
kotlinxBinaryCompatibilityValidatorVersion.convention("0.13.1")
97+
kotlinxBinaryCompatibilityValidatorVersion.convention(BCVProperties.bcvVersion)
10198
}
10299

103100
extension.targets.configureEach {

modules/bcv-gradle-plugin/src/main/kotlin/workers/BCVSignaturesWorker.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ abstract class BCVSignaturesWorker : WorkAction<BCVSignaturesWorker.Parameters>
105105
.filterOutAnnotated(ignoredMarkers.map(::replaceDots).toSet())
106106
}
107107

108+
// Hack to access internal properties :(
109+
// See https://github.com/Kotlin/binary-compatibility-validator/issues/178
110+
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
108111
private fun writeSignatures(
109112
outputApiDir: File,
110113
projectName: String?,

0 commit comments

Comments
 (0)