diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2021-04-22 15:31:33 +0300 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2021-04-27 19:16:16 +0300 |
commit | b59dffbd6d5d00e81e559ab94cfc70df9203f0ad (patch) | |
tree | ce5e2c0c3475a7cedd576deafddd0a8a6325bb48 /app/build.gradle | |
parent | 87ced6d7bc992f9f0ea1cc1b65058b4739714cd1 (diff) |
configure threshold for detekt and solve checking issues
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Diffstat (limited to 'app/build.gradle')
-rw-r--r-- | app/build.gradle | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/build.gradle b/app/build.gradle index 3d3f4e739..7f9f495e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,6 +23,11 @@ apply plugin: 'kotlin-android' apply plugin: 'findbugs' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' +apply plugin: 'io.gitlab.arturbosch.detekt' + +configurations { + ktlint +} def taskRequest = getGradle().getStartParameter().getTaskRequests().toString() if (taskRequest.contains("Gplay") || taskRequest.contains("findbugs") || taskRequest.contains("lint")) { @@ -172,6 +177,7 @@ dependencies { implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', { exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser }) + ktlint "com.pinterest:ktlint:0.41.0" implementation 'org.conscrypt:conscrypt-android:2.5.1' @@ -283,6 +289,30 @@ dependencies { findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.6' } +task ktlint(type: JavaExec, group: "verification") { + description = "Check Kotlin code style." + main = "com.pinterest.ktlint.Main" + classpath = configurations.ktlint + args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt" +} + +task ktlintFormat(type: JavaExec, group: "formatting") { + description = "Fix Kotlin code style deviations." + main = "com.pinterest.ktlint.Main" + classpath = configurations.ktlint + args "-F", "src/**/*.kt" +} + +detekt { + reports { + xml { + enabled = false + } + } + config = files("../detekt.yml") + input = files("src/") +} + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { jvmTarget = "1.8" |