Add detekt, ktlint, and upgrade Gradle wrapper
parent
d6d844a656
commit
99a72fc7f4
34
build.gradle
34
build.gradle
|
@ -14,6 +14,10 @@ buildscript {
|
|||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("io.gitlab.arturbosch.detekt").version("1.0.0.RC9.2")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
|
@ -30,3 +34,33 @@ allprojects {
|
|||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
detekt {
|
||||
// The version number is duplicated, please refer to plugins block for more details
|
||||
version = "1.0.0.RC9.2"
|
||||
input = files("$projectDir/app")
|
||||
config = files("$projectDir/config/detekt.yml")
|
||||
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
|
||||
|
||||
reports {
|
||||
html {
|
||||
enabled = true
|
||||
destination = file("$projectDir/build/reports/detekt.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
ktlint
|
||||
}
|
||||
|
||||
dependencies {
|
||||
ktlint "com.github.shyiko:ktlint:0.24.0"
|
||||
}
|
||||
|
||||
task ktlint(type: JavaExec, group: "verification") {
|
||||
description = "Check Kotlin code style."
|
||||
classpath = configurations.ktlint
|
||||
main = "com.github.shyiko.ktlint.Main"
|
||||
args "app/**/*.kt"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
Loading…
Reference in New Issue