-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
67 lines (64 loc) · 2.15 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath(versionCatalogLibs.android.gradle.plugin)
classpath(versionCatalogLibs.kotlin.gradle.plugin)
classpath(versionCatalogLibs.jacoco.core)
}
}
@Suppress("DSL_SCOPE_VIOLATION") // scope violation issue: work around suggested from: https://github.com/gradle/gradle/issues/22797
plugins {
alias(versionCatalogLibs.plugins.kotlin.serialization) apply false
alias(versionCatalogLibs.plugins.hilt) apply false
alias(versionCatalogLibs.plugins.ksp) apply false
alias(versionCatalogLibs.plugins.sonar)
alias(versionCatalogLibs.plugins.dokka)
alias(versionCatalogLibs.plugins.ktlint)
id("ytemplate.android.project.jacoco")
}
sonarqube {
val sonarProperties = readProperties(file("sonar-project.properties"))
properties {
property("sonar.projectKey", sonarProperties["sonar.projectKey"].toString())
property("sonar.organization", sonarProperties["sonar.organization"].toString())
property("sonar.host.url", sonarProperties["sonar.host.url"].toString())
// Enable this property for local testing
property("sonar.login", sonarProperties["sonar.login"].toString())
}
}
subprojects {
apply(plugin = "org.sonarqube")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
}
ktlint {
version.set("0.48.2") // todo refer from version catalogs
debug.set(true)
verbose.set(true)
android.set(true)
outputToConsole.set(true)
reporters {
setOf(
org.jlleitschuh.gradle.ktlint.reporter.ReporterType.HTML,
org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE
)
}
ignoreFailures.set(true)
kotlinScriptAdditionalPaths {
include(fileTree("scripts/"))
}
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}
fun readProperties(propertiesFile: File) = java.util.Properties().apply {
propertiesFile.inputStream().use { fis ->
load(fis)
}
}