-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
58 lines (53 loc) · 2.26 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
plugins {
id("com.joetr.sync.sphere.root")
kotlin("multiplatform").version(libs.versions.kotlin).apply(false)
id("com.android.application").version(libs.versions.agp).apply(false)
id("com.android.library").version(libs.versions.agp).apply(false)
id("org.jetbrains.compose").version(libs.versions.compose).apply(false)
alias(libs.plugins.spotless) apply false
alias(libs.plugins.kotlin.serialization) apply false
id("io.gitlab.arturbosch.detekt").version(libs.versions.detektGradlePlugin)
id("com.google.gms.google-services").version("4.3.14").apply(false)
id("com.google.firebase.crashlytics") version "2.9.9" apply false
}
subprojects {
apply(from = "$rootDir/buildscripts/detekt.gradle")
}
tasks {
val detektAll by registering(io.gitlab.arturbosch.detekt.Detekt::class) {
parallel = true
setSource(files(projectDir))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
config.setFrom(files("$rootDir/config/detekt/detekt.yml"))
baseline.set(file("$rootDir/config/detekt/baseline.xml"))
buildUponDefaultConfig = false
}
val detektGenerateBaseline by registering(io.gitlab.arturbosch.detekt.DetektCreateBaselineTask::class) {
baseline.set(file("$rootDir/config/detekt/baseline.xml"))
setSource(files(projectDir))
config.setFrom(files("$rootDir/config/detekt/detekt.yml"))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**", "**/build/**")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask<*>>().configureEach {
compilerOptions {
allWarningsAsErrors.set(true)
if (project.hasProperty("enableComposeCompilerReports")) {
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
layout.buildDirectory.asFile.get().absolutePath + "/compose_metrics",
)
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
layout.buildDirectory.asFile.get().absolutePath + "/compose_metrics",
)
}
}
}