-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
63 lines (55 loc) · 1.99 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.HTML
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.JSON
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.SARIF
plugins {
alias(libs.plugins.ktlint) apply true
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.hilt) apply false
}
tasks.register("checkJavaVersion") {
doLast {
println("Gradle is using Java version: ${JavaVersion.current()}")
println("Gradle is using Java home: ${System.getProperty("java.home")}")
}
}
tasks.register("runDefault", Exec::class.java) {
dependsOn(":catalog:installDebug")
val packageName = "com.mobilez.catalog"
val mainActivity = "com.mobilez.catalog.MainActivity"
doFirst {
commandLine("adb", "shell", "am", "start", "-n", "$packageName/$mainActivity")
}
}
tasks.register("cleanAll", Delete::class) {
delete(rootProject.buildDir)
allprojects.forEach { project ->
delete(project.buildDir)
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
debug.set(true)
android.set(true)
outputColorName.set("RED")
disabledRules.set(listOf("no-wildcard-imports"))
verbose.set(true)
outputToConsole.set(true)
ignoreFailures.set(false)
enableExperimentalRules.set(false)
reporters {
reporter(HTML)
reporter(CHECKSTYLE)
reporter(SARIF)
reporter(PLAIN)
reporter(JSON)
}
}
}