-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
109 lines (94 loc) · 3.21 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
import com.eygraber.conventions.kotlin.KotlinFreeCompilerArg
import com.eygraber.conventions.tasks.deleteRootBuildDirWhenCleaning
import com.google.common.base.CaseFormat
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
buildscript {
dependencies {
classpath(libs.buildscript.android)
classpath(libs.buildscript.androidCacheFix)
classpath(libs.buildscript.compose.compiler)
classpath(libs.buildscript.compose.jetbrains)
classpath(libs.buildscript.detekt)
classpath(libs.buildscript.dokka)
classpath(libs.buildscript.kotlin)
classpath(libs.buildscript.kotlinxSerialization)
classpath(libs.buildscript.publish)
}
}
plugins {
base
alias(libs.plugins.conventions)
alias(libs.plugins.dependencyAnalysisRoot)
}
deleteRootBuildDirWhenCleaning()
gradleConventionsDefaults {
android {
sdkVersions(
compileSdk = libs.versions.android.sdk.compile,
targetSdk = libs.versions.android.sdk.target,
minSdk = libs.versions.android.sdk.min,
)
}
detekt {
plugins(libs.detektCompose)
plugins(libs.detektEygraber.formatting)
plugins(libs.detektEygraber.style)
}
kotlin {
jvmTargetVersion = JvmTarget.JVM_11
explicitApiMode = ExplicitApiMode.Strict
freeCompilerArgs = setOf(KotlinFreeCompilerArg.AllowExpectActualClasses)
allWarningsAsErrors = true
}
}
gradleConventionsKmpDefaults {
webOptions = KmpTarget.WebOptions(
isNodeEnabled = false,
isBrowserEnabled = true,
)
targets(
KmpTarget.Android,
KmpTarget.Ios,
KmpTarget.Js,
KmpTarget.Jvm,
KmpTarget.WasmJs,
)
}
dependencyAnalysis {
issues {
all {
onAny {
severity("fail")
exclude("androidx.compose.animation:animation")
exclude("androidx.compose.animation:animation-core")
exclude("androidx.compose.foundation:foundation")
exclude("androidx.compose.foundation:foundation-layout")
exclude("androidx.compose.material3:material3")
exclude("androidx.compose.runtime:runtime")
exclude("androidx.compose.runtime:runtime-saveable")
exclude("androidx.compose.ui:ui")
exclude("androidx.navigation:navigation-common")
exclude("androidx.navigation:navigation-compose")
exclude("androidx.navigation:navigation-runtime")
exclude("org.jetbrains.kotlin:kotlin-stdlib")
}
// currently broken for KMP - https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/228
onUsedTransitiveDependencies {
severity("ignore")
}
}
}
structure {
// Adds the defined aliases in the version catalog to be used when printing advice and rewriting build scripts.
val versionCatalogName = "libs"
val versionCatalog = project.extensions.getByType<VersionCatalogsExtension>().named(versionCatalogName)
versionCatalog.libraryAliases.forEach { alias ->
map.put(versionCatalog.findLibrary(alias).get().get().toString(), "$versionCatalogName.$alias")
}
subprojects.forEach { subproject ->
val projectAccessor = CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, subproject.path.replace(':', '.'))
map.put(subproject.path, "projects$projectAccessor")
}
}
}