This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): replace homebrew ktfmt formatter with Spotless
Spotless has fixed their Gradle Configuration Cache woes in the past couple months which gets rid of my primary complaint.
- Loading branch information
Showing
15 changed files
with
65 additions
and
243 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
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
37 changes: 0 additions & 37 deletions
37
build-logic/src/main/kotlin/app/passwordstore/gradle/KtfmtPlugin.kt
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
build-logic/src/main/kotlin/app/passwordstore/gradle/SpotlessPlugin.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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.51" | ||
} | ||
} |
63 changes: 0 additions & 63 deletions
63
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtCheckTask.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtDiffEntry.kt
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtDiffer.kt
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtFormatTask.kt
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerParameters.kt
This file was deleted.
Oops, something went wrong.
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