From 7780d36b540814018b468884d03025d464cd5205 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Thu, 20 Aug 2020 15:36:49 +0200 Subject: Upgrade ktlint and re-enable import order check --- build.gradle.kts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'build.gradle.kts') 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 { @@ -27,18 +35,9 @@ subprojects { tasks.withType { 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 { - disabledRules.set(setOf("import-ordering", "no-wildcard-imports")) - } - } } -- cgit