-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.gradle.kts
81 lines (69 loc) · 2.18 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url = uri("https://plugins.gradle.org/m2/") }
maven { url = uri("https://jitpack.io") }
}
dependencies {
classpath(Plugins.CLASSPATH_GRADLE)
classpath(kotlin("gradle-plugin", version = PluginVersion.KOTLIN_VERSION))
classpath(Plugins.CLASSPATH_DAGGER_HILT)
classpath(Plugins.CLASSPATH_KTLINT)
classpath(Plugins.CLASSPATH_NAV_SAFE_ARGS)
classpath(Plugins.CLASSPATH_MP_CHART)
}
}
plugins {
id(Plugins.KTLINT) version PluginVersion.KTLINT_VERSION
id(Plugins.DETEKT) version PluginVersion.DETEKT_VERSION
}
allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
subprojects {
tasks.withType<Test> {
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
}
// KtLint
apply(plugin = Plugins.KTLINT) // Version should be inherited from parent
// KtLint Configurations
ktlint {
debug.set(true)
verbose.set(true)
android.set(true)
outputToConsole.set(true)
}
// Detekt
apply(plugin = Plugins.DETEKT)
detekt {
config = files("${project.rootDir}/config/detekt/detekt.yml")
parallel = true
reports {
xml {
enabled = true
destination = file("${project.rootDir}/build/reports/detekt_report.xml")
}
html {
enabled = true
destination = file("${project.rootDir}/build/reports/detekt_report.html")
}
txt {
enabled = true
destination = file("${project.rootDir}/build/reports/detekt_report.txt")
}
}
}
}
// JVM target applied to all Kotlin tasks across all sub-projects
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}