Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Version Catalog Setup Instructions in README #770

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading