feat: rip out Spotless

Spotless' configuration cache support is irritating since it requires you to wipe config cache
every time you initialise a Gradle daemon.
This commit is contained in:
Harsh Shandilya 2022-10-29 08:10:44 +05:30
parent fd20480f55
commit 56fd18b17d
No known key found for this signature in database
7 changed files with 2 additions and 65 deletions

View file

@ -47,10 +47,6 @@ gradlePlugin {
id = "com.github.android-password-store.ktfmt"
implementationClass = "app.passwordstore.gradle.KtfmtPlugin"
}
register("spotless") {
id = "com.github.android-password-store.spotless"
implementationClass = "app.passwordstore.gradle.SpotlessPlugin"
}
register("versions") {
id = "com.github.android-password-store.versions"
implementationClass = "app.passwordstore.gradle.DependencyUpdatesPlugin"
@ -65,7 +61,6 @@ dependencies {
implementation(libs.build.kotlin)
implementation(libs.build.ktfmt)
implementation(libs.build.r8)
implementation(libs.build.spotless)
implementation(libs.build.vcu)
implementation(libs.build.versions)
implementation(libs.kotlin.coroutines.core)

View file

@ -1,44 +0,0 @@
/*
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
package app.passwordstore.gradle
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.getByType
@Suppress("Unused")
class SpotlessPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.pluginManager.apply(SpotlessPlugin::class)
project.extensions.getByType<SpotlessExtension>().run {
kotlin {
ktfmt(KTFMT_VERSION).googleStyle()
target("**/*.kt")
targetExclude("**/build/")
}
kotlinGradle {
ktfmt(KTFMT_VERSION).googleStyle()
target("**/*.kts")
targetExclude("**/build/")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/", ".idea/")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
}
private companion object {
private const val KTFMT_VERSION = "0.41"
}
}