From b2d352e3ea671e84cc4f356a49786d1d3b2eaef6 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 6 Nov 2019 19:41:15 +0530 Subject: Revert back to Groovy DSL The Kotlin DSL's API is extremely terrible and makes the simplest tasks annoying. It also introduces a very noticeable build overhead that I'd rather not have. Signed-off-by: Harsh Shandilya --- buildSrc/build.gradle.kts | 20 --------- buildSrc/src/main/kotlin/SpotlessConfiguration.kt | 51 ----------------------- 2 files changed, 71 deletions(-) delete mode 100644 buildSrc/build.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/SpotlessConfiguration.kt (limited to 'buildSrc') diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 24b366c0..00000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ -plugins { - `kotlin-dsl` -} - -repositories { - maven("https://plugins.gradle.org/m2/") - jcenter() -} - -kotlinDslPluginOptions { - experimentalWarning.set(false) -} - -dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:3.24.3") -} diff --git a/buildSrc/src/main/kotlin/SpotlessConfiguration.kt b/buildSrc/src/main/kotlin/SpotlessConfiguration.kt deleted file mode 100644 index ff8ce05b..00000000 --- a/buildSrc/src/main/kotlin/SpotlessConfiguration.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ -import com.diffplug.gradle.spotless.SpotlessExtension -import com.diffplug.gradle.spotless.SpotlessPlugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure - -val kotlinLicenseHeader = """/* - * Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ -""".trimIndent() - -fun Project.configureSpotless() { - apply() - - configure { - java { - target("**/src/main/**/*.java") - trimTrailingWhitespace() - @Suppress("INACCESSIBLE_TYPE") - licenseHeader(kotlinLicenseHeader) - removeUnusedImports() - googleJavaFormat().aosp() - endWithNewline() - } - - kotlinGradle { - target("*.gradle.kts", "gradle/*.gradle.kts", "buildSrc/*.gradle.kts") - ktlint("0.31.0").userData(mapOf("indent_size" to "4", "continuation_indent_size" to "4")) - @Suppress("INACCESSIBLE_TYPE") - licenseHeader(kotlinLicenseHeader, "import|tasks|apply|plugins|include|buildscript") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } - - kotlin { - target("**/src/main/**/*.kt", "buildSrc/**/*.kt") - ktlint("0.31.0").userData(mapOf("indent_size" to "4", "continuation_indent_size" to "4")) - @Suppress("INACCESSIBLE_TYPE") - licenseHeader(kotlinLicenseHeader, "import|package|class|object|@file") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } - } -} -- cgit v1.2.3