-
Notifications
You must be signed in to change notification settings - Fork 30
/
CCC.gradle.kts
executable file
·71 lines (63 loc) · 2.25 KB
/
CCC.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
/*
* Copyright (c) 2020 Mustafa Ozhan. All rights reserved.
*/
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
libs.plugins.apply {
alias(kotlinMultiplatform).apply(false)
alias(jetbrainsCompose).apply(false)
alias(kotlinJvm).apply(false)
alias(kotlinAndroid).apply(false)
alias(androidApplication).apply(false)
alias(androidLibrary).apply(false)
alias(buildKonfig).apply(false)
alias(sqlDelight).apply(false)
alias(kover)
alias(detekt)
}
}
group = ProjectSettings.PROJECT_ID
version = ProjectSettings.getVersionName(project)
allprojects {
apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
rootProject.dependencies.add("kover", project(path))
kover.reports.filters.excludes.annotatedBy(
"com.oztechan.ccc.android.ui.compose.annotations.ThemedPreviews",
"androidx.compose.ui.tooling.preview.Preview",
"androidx.compose.runtime.Composable"
)
}
apply(plugin = rootProject.libs.plugins.detekt.get().pluginId).also {
detekt {
buildUponDefaultConfig = true
allRules = true
parallel = true
config.from(rootProject.layout.projectDirectory.file("detekt.yml"))
}
tasks.withType<Detekt> {
// Use providers to avoid direct project references
val projectDirectory = layout.projectDirectory.asFile
val buildDirectory = layout.buildDirectory.asFile
setSource(projectDirectory)
exclude("**/build/**")
exclude {
val relativePath = it.file.relativeTo(projectDirectory)
relativePath.startsWith(buildDirectory.get().relativeTo(projectDirectory))
}
}
tasks.register("detektAll") {
dependsOn(tasks.withType<Detekt>())
}
dependencies {
detektPlugins(rootProject.libs.common.detektFormatting)
}
}
tasks.withType<KotlinCompile> {
compilerOptions {
// todo remove when not needed anymore
freeCompilerArgs.add("-Xexpect-actual-classes")
allWarningsAsErrors = true
}
}
}