build-logic: migrate Spotless to a convention plugin
This commit is contained in:
parent
1040552dbf
commit
96a9211f9e
9 changed files with 62 additions and 34 deletions
1
build-logic/.gitignore
vendored
Normal file
1
build-logic/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/build
|
3
build-logic/build.gradle.kts
Normal file
3
build-logic/build.gradle.kts
Normal file
|
@ -0,0 +1,3 @@
|
|||
plugins { `kotlin-dsl` }
|
||||
|
||||
dependencies { implementation(libs.build.spotless) }
|
29
build-logic/settings.gradle.kts
Normal file
29
build-logic/settings.gradle.kts
Normal file
|
@ -0,0 +1,29 @@
|
|||
rootProject.name = "build-logic"
|
||||
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } }
|
||||
}
|
||||
|
||||
rootProject.name = "build-logic"
|
||||
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
|
||||
include("android-plugins")
|
||||
|
||||
include("automation-plugins")
|
||||
|
||||
include("kotlin-plugins")
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
plugins { id("com.diffplug.spotless") }
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
ktfmt().googleStyle()
|
||||
target("**/*.kt")
|
||||
targetExclude("**/build/")
|
||||
}
|
||||
kotlinGradle {
|
||||
ktfmt().googleStyle()
|
||||
target("**/*.kts")
|
||||
}
|
||||
format("xml") {
|
||||
target("**/*.xml")
|
||||
targetExclude("**/build/", ".idea/")
|
||||
trimTrailingWhitespace()
|
||||
indentWithSpaces()
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue