-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
136 lines (124 loc) · 3.06 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.plugin.androidTools)
classpath(kotlin("gradle-plugin", version = libs.versions.kotlin.get()))
classpath(libs.plugin.hiltAndroidGradle)
classpath(libs.plugin.mavenPublish)
}
}
plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.detekt)
id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get()
}
spotless {
format("misc") {
target("*.md", ".gitignore")
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
kotlin {
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "2",
"disabled_rules" to "no-wildcard-imports",
"ij_kotlin_allow_trailing_comma" to "false",
"ij_kotlin_allow_trailing_comma_on_call_site" to "false"
)
)
target("**/*.kt")
trimTrailingWhitespace()
endWithNewline()
targetExclude("**/build/**", "**/GeneratedLibraries.kt")
}
kotlinGradle {
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "2",
"ij_kotlin_allow_trailing_comma" to "false",
"ij_kotlin_allow_trailing_comma_on_call_site" to "false"
)
)
target("**/*.gradle.kts")
trimTrailingWhitespace()
endWithNewline()
targetExclude("**/build/**")
}
}
dependencyAnalysis {
issues {
all {
onIncorrectConfiguration {
severity("fail")
}
onUnusedDependencies {
severity("fail")
}
}
project(":sample:app") {
onUnusedDependencies {
severity("fail")
// These are used by the hilt compiler plugin
exclude(
"androidx.hilt:hilt-navigation-compose",
"com.google.dagger:dagger",
":sample:features:feature1",
":sample:features:feature2"
)
}
}
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
val rootDir = projectDir
subprojects {
buildscript {
repositories {
google()
mavenCentral()
}
}
repositories {
google()
mavenCentral()
}
pluginManager.withPlugin("java") {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=androidx.compose.foundation.ExperimentalFoundationApi"
)
}
}
configurations.all {
resolutionStrategy {
eachDependency {
when (requested.module.toString()) {
"androidx.compose.runtime:runtime" -> useVersion(libs.versions.compose.get())
"androidx.compose.ui:ui" -> useVersion(libs.versions.compose.get())
}
}
}
}
}