-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Kotlinter in process isolation (#420)
* Run Kotlinter in classloader isolation First in a series of changes leading to a 5.0.0 release. Starting with Kotlin 2.1.0 it's no longer acceptable to run ktlint and the embedded Kotlin compiler in the main Gradle classloader. The solution is to use classloader Gradle worker isolation. Positive consequences: - Users can configure the version of ktlint - Kotlinter is compatible with any version of Kotlin with matching language specification Side effects to watch: - Performance may be slower - Potential [Gradle memory issues](gradle/gradle#18313) * Switch to process isolation and refactor settings for build failure
- Loading branch information
1 parent
bd47834
commit 19ef1fe
Showing
17 changed files
with
185 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
src/main/kotlin/org/jmailen/gradle/kotlinter/KotlinterExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package org.jmailen.gradle.kotlinter | ||
|
||
import org.jmailen.gradle.kotlinter.support.ReporterType | ||
import org.jmailen.gradle.kotlinter.support.versionProperties | ||
|
||
open class KotlinterExtension { | ||
companion object { | ||
const val DEFAULT_FAIL_BUILD_WHEN_CANNOT_AUTO_FORMAT = false | ||
const val DEFAULT_IGNORE_FAILURES = false | ||
const val DEFAULT_IGNORE_FORMAT_FAILURES = true | ||
const val DEFAULT_IGNORE_LINT_FAILURES = false | ||
val DEFAULT_REPORTER = ReporterType.checkstyle.name | ||
} | ||
|
||
var failBuildWhenCannotAutoFormat = DEFAULT_FAIL_BUILD_WHEN_CANNOT_AUTO_FORMAT | ||
var ignoreFailures = DEFAULT_IGNORE_FAILURES | ||
var ktlintVersion = versionProperties.ktlintVersion() | ||
var ignoreFormatFailures = DEFAULT_IGNORE_FORMAT_FAILURES | ||
var ignoreLintFailures = DEFAULT_IGNORE_LINT_FAILURES | ||
var reporters = arrayOf(DEFAULT_REPORTER) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.