Skip to content

Commit e1855e7

Browse files
committed
update README example for settings plugin
1 parent f3a30e9 commit e1855e7

File tree

1 file changed

+44
-15
lines changed

1 file changed

+44
-15
lines changed

README.md

+44-15
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
# Kotlin Binary Compatibility Validator (Mirror Universe)
55

6-
[BCV-MU](https://github.com/adamko-dev/kotlin-binary-compatibility-validator-mu) is a re-imagined [Gradle](https://gradle.org/) Plugin for
6+
[BCV-MU](https://github.com/adamko-dev/kotlin-binary-compatibility-validator-mu) is a
7+
re-imagined [Gradle](https://gradle.org/) Plugin for
78
[Kotlin/binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator).
89

910
This plugin validates the public JVM binary API of libraries to make sure that breaking changes are
@@ -194,28 +195,56 @@ All subprojects are included by default, and can be excluded using BCV-MU config
194195

195196
buildscript {
196197
dependencies {
197-
// BCV-MU requires the Kotlin Gradle Plugin classes are present
198-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
198+
// BCV-MU requires the Kotlin Gradle Plugin classes are present
199+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.8.10")
199200
}
200201
}
201202

202203
plugins {
203204
id("dev.adamko.kotlin.binary-compatibility-validator") version "$bcvMuVersion"
204205
}
205206

206-
extensions
207-
.getByType<dev.adamko.kotlin.binary_compatibility_validator.BCVSettingsPlugin.Extension>()
208-
.apply {
209-
ignoredProjects.addAll(
210-
211-
// ignore subprojects explicitly
212-
":some-subproject",
213-
214-
// or ignore using a glob pattern
215-
":internal-dependencies:**",
216-
":*-tasks:**",
217-
)
207+
binaryCompatibilityValidator {
208+
ignoredProjects.addAll(
209+
210+
":", // ignore root project
211+
":some-subproject", // ignore subprojects explicitly
212+
213+
// or ignore using a glob pattern
214+
":internal-dependencies:*",
215+
":*-tasks:**",
216+
)
217+
218+
// set the default values for all targets in all enabled-subprojects
219+
defaultTargetValues {
220+
enabled.convention(true)
221+
ignoredClasses.set(listOf("com.package.MyIgnoredClass"))
222+
ignoredMarkers.set(listOf("com.package.MyInternalApiAnnotationMarker"))
223+
ignoredPackages.set(listOf("com.package.my_ignored_package"))
218224
}
225+
}
226+
227+
include(
228+
// these projects will have BCV-MU automatically applied
229+
":common",
230+
":internal-dependencies:alpha:nested",
231+
":internal-dependencies:alpha:nested",
232+
":a-task",
233+
234+
// this subproject is explicitly excluded from BCV
235+
":some-subproject",
236+
237+
// these subprojects will be excluded by glob pattern
238+
":internal-dependencies",
239+
":internal-dependencies:alpha",
240+
":internal-dependencies:beta",
241+
":x-tasks",
242+
":x-tasks:sub1",
243+
":x-tasks:sub1:sub2",
244+
":z-tasks",
245+
":z-tasks:sub1",
246+
":z-tasks:sub1:sub2",
247+
)
219248
```
220249

221250
## License

0 commit comments

Comments
 (0)