-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
103 lines (86 loc) · 2.82 KB
/
build.gradle.kts
File metadata and controls
103 lines (86 loc) · 2.82 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
// 🔥 Groovy DSL
// maven {url "https://plugins.gradle.org/m2/"}
// 🔥 Kotlin DSL
maven { url = uri("https://plugins.gradle.org/m2/") }
}
// 🔥 Groovy DSL
// dependencies {
// classpath "com.android.tools.build:gradle:4.1.0-beta04"
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//
// // NOTE: Do not place your application dependencies here; they belong
// // in the individual module build.gradle files
//
// classpath "org.jlleitschuh.gradle:ktlint-gradle:9.3.0"
//
// }
// 🔥 Kotlin DSL
// dependencies {
// classpath("com.android.tools.build:gradle:4.1.0-beta04")
// classpath(kotlin("gradle-plugin", version = "1.3.72"))
// classpath("org.jlleitschuh.gradle:ktlint-gradle:9.3.0")
// }
// 🔥 Kotlin DSL + BuildSrc
dependencies {
classpath(Plugins.CLASSPATH_GRADLE)
classpath(kotlin("gradle-plugin", version = PluginVersion.KOTLIN_VERSION))
classpath(Plugins.CLASSPATH_DAGGER_HILT)
classpath(Plugins.CLASSPATH_KTLINT)
}
}
// plugins {
// id("org.jlleitschuh.gradle.ktlint") version GradlePluginVersion.KTLINT_VERSION
// id("io.gitlab.arturbosch.detekt") version GradlePluginVersion.DETEKT_VERSION
// }
plugins {
id(Plugins.KTLINT) version PluginVersion.KTLINT_VERSION
id(Plugins.DETEKT) version PluginVersion.DETEKT_VERSION
}
allprojects {
repositories {
google()
jcenter()
}
// 🔥 Groovy
// apply plugin: "org.jlleitschuh.gradle.ktlint"
}
subprojects {
// KtLint
apply(plugin = Plugins.KTLINT) // Version should be inherited from parent
// Optionally configure plugin
ktlint {
debug.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)
}