Add spotless plugin for code formatting and rule for Kotlin sources
This commit is contained in:
parent
697f201c15
commit
713dbf9462
2 changed files with 15 additions and 1 deletions
12
build.gradle
12
build.gradle
|
@ -11,6 +11,7 @@ plugins {
|
|||
alias(libs.plugins.kotlin.parcelize) apply false
|
||||
alias(libs.plugins.kotlin.jvm) apply false
|
||||
alias(libs.plugins.ktlint) apply false
|
||||
alias(libs.plugins.spotless)
|
||||
}
|
||||
|
||||
project.ext {
|
||||
|
@ -101,6 +102,17 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
ktlint(libs.versions.ktlint.get())
|
||||
.setEditorConfigPath("$projectDir/.editorconfig")
|
||||
target("**/*.kt")
|
||||
targetExclude("**/build/", "**/resources/")
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('testsOnCi') {
|
||||
dependsOn getSubprojects()
|
||||
.collect { project -> project.tasks.withType(Test) }
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
[versions]
|
||||
androidGradlePlugin = "7.4.0"
|
||||
ktlint = "0.44.0"
|
||||
ktlint = "0.47.1"
|
||||
spotless = "6.14.0"
|
||||
|
||||
kotlin = "1.8.0"
|
||||
kotlinCoroutines = "1.6.4"
|
||||
|
@ -39,6 +40,7 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|||
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
ktlint = "org.jlleitschuh.gradle.ktlint:11.0.0"
|
||||
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
|
||||
|
||||
[libraries]
|
||||
desugar = "com.android.tools:desugar_jdk_libs:1.1.8"
|
||||
|
|
Loading…
Reference in a new issue