diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-08-20 15:36:49 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-08-20 16:08:49 +0200 |
commit | 7780d36b540814018b468884d03025d464cd5205 (patch) | |
tree | 21ac4bb1acf1b126bf805f55555d10a25aa420db /build.gradle.kts | |
parent | Fix style & sort imports (diff) | |
download | seven-wonders-7780d36b540814018b468884d03025d464cd5205.tar.gz seven-wonders-7780d36b540814018b468884d03025d464cd5205.tar.bz2 seven-wonders-7780d36b540814018b468884d03025d464cd5205.zip |
Upgrade ktlint and re-enable import order check
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index d1c0fb73..d7972105 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ -import org.gradle.api.tasks.testing.logging.TestLogEvent.* +import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { val kotlinVersion = "1.3.72" @@ -6,14 +6,22 @@ plugins { kotlin("jvm") version kotlinVersion apply false kotlin("multiplatform") version kotlinVersion apply false kotlin("plugin.spring") version kotlinVersion apply false - id("org.jetbrains.kotlin.plugin.serialization") version kotlinVersion apply false - id("org.jlleitschuh.gradle.ktlint") version "9.1.1" apply false + kotlin("plugin.serialization") version kotlinVersion apply false + id("org.jlleitschuh.gradle.ktlint") version "9.3.0" } -subprojects { +allprojects { repositories { jcenter() } +} + +subprojects { + apply(plugin = "org.jlleitschuh.gradle.ktlint") + + ktlint { + disabledRules.set(setOf("no-wildcard-imports")) + } val compilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { @@ -27,18 +35,9 @@ subprojects { tasks.withType<AbstractTestTask> { testLogging { - events(FAILED, STANDARD_ERROR) + events(TestLogEvent.FAILED, TestLogEvent.STANDARD_ERROR) exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL showStackTraces = true } } - - afterEvaluate { - // The import ordering expected by ktlint is alphabetical, which doesn't match IDEA's formatter. - // Since it is not configurable, we have to disable the rule. - // https://github.com/pinterest/ktlint/issues/527 - extensions.configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> { - disabledRules.set(setOf("import-ordering", "no-wildcard-imports")) - } - } } |