-
Notifications
You must be signed in to change notification settings - Fork 514
/
build.gradle.kts
70 lines (63 loc) · 2.28 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
import com.kizitonwose.calendar.buildsrc.Version
import com.kizitonwose.calendar.buildsrc.Version.isNoPublish
import com.kizitonwose.calendar.buildsrc.androidProjects
import com.kizitonwose.calendar.buildsrc.multiplatformProjects
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.kotlinSerialization) apply false
alias(libs.plugins.versionCheck)
alias(libs.plugins.bcv)
}
allprojects {
apply(plugin = rootProject.libs.plugins.kotlinter.get().pluginId)
plugins.withType<KotlinBasePlugin> {
extensions.configure<KotlinProjectExtension> {
if ("sample" !in project.name) {
explicitApi()
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
}
afterEvaluate {
// Android and Multiplatform libraries are published separately
// See https://github.com/kizitonwose/Calendar/pull/561
disableMavenPublicationsIfNeeded(multiplatformProjects, Version.multiplatfrom)
disableMavenPublicationsIfNeeded(androidProjects, Version.android)
}
}
fun Project.disableMavenPublicationsIfNeeded(
projects: List<String>,
version: String,
) {
if (version.isNoPublish() && project.name in projects) {
tasks.withType<AbstractPublishToMaven> {
enabled = false
}
}
}
apiValidation {
ignoredProjects += listOf(
"sample",
)
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
klib {
enabled = true
}
}
// tasks.register<Delete>("clean").configure {
// delete(rootProject.layout.buildDirectory)
// }