Skip to content

Commit

Permalink
Add faq entry about Kotlin version pinning.
Browse files Browse the repository at this point in the history
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
  • Loading branch information
Tapchicoma committed Sep 5, 2020
1 parent 7904664 commit 185d657
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,28 @@ To filter files outside project dir, use:
exclude { element -> element.file.path.contains("generated/") }
```

- Running KtLint fails with strange exception (for example, check [#383](https://github.com/JLLeitschuh/ktlint-gradle/issues/383))

Ensure you are not pinning Kotlin version for "ktlint*" configurations added by plugin.

KtLint relies on Kotlin compiler to parse source files. Each version of KtLint are build using specific Kotlin version.

To exclude "ktlint*" Gradle configurations from Kotlin version pinning - use following approach:
```kotlin
configurations.all {
if (!name.startsWith("ktlint")) {
resolutionStrategy {
eachDependency {
// Force Kotlin to our version
if (requested.group == "org.jetbrains.kotlin") {
useVersion("1.3.72")
}
}
}
}
}
```

## Developers

### Importing
Expand Down

0 comments on commit 185d657

Please sign in to comment.