Skip to content

Commit

Permalink
Adapt README for new version, use kotlin for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
REPLicated committed May 17, 2024
1 parent eba06cb commit e73f8b6
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@ Fails the build whenever an unexpected duplicate entry is found in two or more a

The plugin requires Gradle 6.6 or newer.

You can either apply the plugin with the plugins block
```groovy
You can apply the plugin with the plugins block
```kotlin
plugins {
id "io.fuchs.gradle.classpath-collision-detector" version "0.3"
id("io.fuchs.gradle.classpath-collision-detector") version "1.0.0"
}
```
or using the legacy version
```groovy
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.fuchs.gradle.classpath-collision-detector:classpath-collision-detector:0.3"
}
}
apply plugin: "io.fuchs.gradle.classpath-collision-detector"
```

Then run `./gradlew detectCollisions` to run the detection.

Expand All @@ -39,18 +24,18 @@ If the project also applies the `java` plugin the task searches the `runtimeClas
### Customization

You can also explicitly specify the configuration
```groovy
tasks.named('detectCollisions', DetectCollisionsTask).configure {
configurations.from(project.configurations.runtimeClasspath)
```
tasks.named<DetectCollisionsTask>("detectCollisions").configure {
configurations.from(project.configurations.runtimeClasspath)
}
```

To ignore certain conflicts you can add exclude patterns that match collisions you are not interested in e.g.

```groovy
tasks.named('detectCollisions', DetectCollisionsTask).configure {
collisionFilter {
exclude('**.html', '**.txt', '**.properties')
}
```kotlin
tasks.named<DetectCollisionsTask>("detectCollisions").configure {
collisionFilter {
exclude("**.html", "**.txt", "**.properties")
}
}
```

0 comments on commit e73f8b6

Please sign in to comment.