-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
83 lines (68 loc) · 2.39 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
plugins {
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.kotlin.jvm).apply(false)
alias(libs.plugins.kotlin.cocoapods).apply(false)
alias(libs.plugins.kotlin.serialization).apply(false)
alias(libs.plugins.ksp).apply(false)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.room).apply(false)
alias(libs.plugins.kotest).apply(false)
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.android.firebase.crashlytics).apply(false)
alias(libs.plugins.android.firebase.perf).apply(false)
alias(libs.plugins.google.services).apply(false)
alias(libs.plugins.ktor.server).apply(false)
alias(libs.plugins.dependency.guard).apply(false)
alias(libs.plugins.buildkonfig).apply(false)
alias(libs.plugins.spotless)
alias(libs.plugins.module.graph)
}
subprojects {
afterEvaluate {
if (isKotlinProject()) {
plugins.apply("com.diffplug.spotless")
spotless {
kotlin {
target("**/*.kt")
targetExclude("**/build/**")
ktlint()
endWithNewline()
indentWithTabs()
trimTrailingWhitespace()
}
}
}
}
}
subprojects {
afterEvaluate {
plugins.apply("com.jraska.module.graph.assertion")
moduleGraphAssert {
configurations += setOf("commonMainImplementation", "commonMainApi", "implementation", "api")
}
}
}
subprojects {
afterEvaluate {
if (pluginManager.findPlugin("org.jetbrains.kotlin.native.cocoapods") != null) {
tasks.register("buildCocoapods") {
dependsOn(tasks.getByName("build"))
}
}
}
}
fun Project.isMultiplatformProject(): Boolean {
return plugins.findPlugin("org.jetbrains.kotlin.multiplatform") != null
}
fun Project.isJvmProject(): Boolean {
return plugins.findPlugin("org.jetbrains.kotlin.jvm") != null
}
fun Project.isAndroidProject(): Boolean {
return plugins.findPlugin("org.jetbrains.kotlin.android") != null
}
fun Project.isKotlinProject(): Boolean {
return isMultiplatformProject() || isJvmProject() || isAndroidProject()
}