Skip to content

Commit

Permalink
Add Version Catalog Setup Instructions in README (#770)
Browse files Browse the repository at this point in the history
* Add the method to set up using  a version catalog

* Update CHANGELOG.md

---------

Co-authored-by: Hina Nakahira <[email protected]>
Co-authored-by: Jonathan Leitschuh <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 6f37566 commit e2a0a63
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Bump al-cheb/configure-pagefile-action from 1.3 to 1.4 [#780](https://github.com/JLLeitschuh/ktlint-gradle/pull/780)
- Update version for jgit to 5.13.3.202401111512-r [#766](https://github.com/JLLeitschuh/ktlint-gradle/pull/766)
- builds: remove specific lintian version, as latest ubuntu is now a new version
[#767](https://github.com/JLLeitschuh/ktlint-gradle/pull/767)
- docs: add Version Catalog setup instructions in README
[#770](https://github.com/JLLeitschuh/ktlint-gradle/pull/770)
[#767](https://github.com/JLLeitschuh/ktlint-gradle/pull/767)

### Fixed
Expand Down
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 e2a0a63

Please sign in to comment.