Skip to content

Commit

Permalink
Add the method to set up using a version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
soleil-colza authored Aug 27, 2024
1 parent f969ca6 commit 686e5bc
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,49 @@ repositories {
```
</details>

#### Using Version Catalog

To configure the plugin using a version catalog, first, add the following entries to your libs.versions.toml file:

```toml
[versions]
ktlint = "<current_version>"

[plugins]
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
```

Next, apply it to your project:

<details>
<summary>Groovy</summary>

```groovy
plugins {
alias(libs.plugins.ktlint)
}
repositories {
// Required to download KtLint
mavenCentral()
}
```
</details>
<details open>
<summary>Kotlin</summary>

```kotlin
plugins {
alias(libs.plugins.ktlint)
}

repositories {
// Required to download KtLint
mavenCentral()
}
```
</details>

#### Using legacy apply method

Build script snippet for use in all Gradle versions:
Expand Down

0 comments on commit 686e5bc

Please sign in to comment.