-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.gradle.kts
61 lines (52 loc) · 1.6 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(GradlePluginId.KTLINT_GRADLE) version CoreVersion.KTLINT_GRADLE
id(GradlePluginId.DETEKT) version CoreVersion.DETEKT
id(GradlePluginId.VERSIONS_PLUGIN) version CoreVersion.VERSIONS_PLUGIN
}
buildscript {
repositories {
// Android plugin & support libraries
google()
// Main open-source repository
jcenter()
// Ktlint Gradle
maven(GradlePluginId.KTLINT_MAVEN)
}
dependencies {
classpath(GradleClasspath.ANDROID_GRADLE)
classpath(kotlin(GradleClasspath.KOTLIN_PlUGIN, version = CoreVersion.KOTLIN))
classpath(GradleClasspath.SAFE_ARGS)
classpath(GradleClasspath.KTLINT_CLASSPATH)
}
}
allprojects {
repositories {
google()
jcenter()
}
// We want to apply ktlint at all project level because it also checks build gradle files
plugins.apply(GradlePluginId.KTLINT_GRADLE)
// Ktlint configuration for sub-projects
ktlint {
version.set(CoreVersion.KTLINT)
verbose.set(true)
android.set(true)
reporters {
reporter(ReporterType.CHECKSTYLE)
}
ignoreFailures.set(true)
filter {
exclude("**/generated/**")
}
}
plugins.apply(GradlePluginId.DETEKT)
detekt {
config = files("${project.rootDir}/config/detekt.yml")
parallel = true
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}