Skip to content

Commit

Permalink
Load ktlint dependency always when Kotlinter applied (#425)
Browse files Browse the repository at this point in the history
Before we only add the dependency configuration when a compatible kotlin
plug is detected which doesn't work for projects with only custom
kotlinter tasks. Fixes #423
  • Loading branch information
jeremymailen authored Dec 12, 2024
1 parent be97894 commit 64d3108
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Available on the Gradle Plugins Portal: https://plugins.gradle.org/plugin/org.jm

```kotlin
plugins {
id("org.jmailen.kotlinter") version "5.0.0"
id("org.jmailen.kotlinter") version "5.0.1"
}
```

Expand All @@ -36,7 +36,7 @@ plugins {

```groovy
plugins {
id "org.jmailen.kotlinter" version "5.0.0"
id "org.jmailen.kotlinter" version "5.0.1"
}
```

Expand All @@ -50,7 +50,7 @@ Root `build.gradle.kts`

```kotlin
plugins {
id("org.jmailen.kotlinter") version "5.0.0" apply false
id("org.jmailen.kotlinter") version "5.0.1" apply false
}
```

Expand All @@ -70,7 +70,7 @@ Root `build.gradle`

```groovy
plugins {
id 'org.jmailen.kotlinter' version "5.0.0" apply false
id 'org.jmailen.kotlinter' version "5.0.1" apply false
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ val githubUrl = "https://github.com/jeremymailen/kotlinter-gradle"
val webUrl = "https://github.com/jeremymailen/kotlinter-gradle"
val projectDescription = "Lint and formatting for Kotlin using ktlint with configuration-free setup on JVM and Android projects"

version = "5.0.0"
version = "5.0.1"
group = "org.jmailen.gradle"
description = projectDescription

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class KotlinterPlugin : Plugin<Project> {

override fun apply(project: Project) = with(project) {
val kotlinterExtension = extensions.create("kotlinter", KotlinterExtension::class.java)
val ktlintConfiguration = createKtLintConfiguration(kotlinterExtension)

if (this == rootProject) {
registerPrePushHookTask()
Expand All @@ -39,7 +40,6 @@ class KotlinterPlugin : Plugin<Project> {
pluginManager.withPlugin(pluginId) {
val lintKotlin = registerParentLintTask()
val formatKotlin = registerParentFormatTask()
val ktlintConfiguration = createKtLintConfiguration(kotlinterExtension)

registerSourceSetTasks(kotlinterExtension, sourceResolver, lintKotlin, formatKotlin)

Expand Down

0 comments on commit 64d3108

Please sign in to comment.