-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathbuild.gradle.kts
94 lines (70 loc) · 2.33 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
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.konan.target.HostManager
extra["globalM2"] = "${project.file("build")}/m2"
extra["publishLocal"] = project.hasProperty("publishLocal")
apply(from = "gradle/verifier.gradle")
val internalProjects = listOf(
"ktor-client-test-base",
"ktor-client-tests",
"ktor-server-test-base",
"ktor-server-test-suites",
"ktor-server-tests",
"ktor-client-content-negotiation-tests",
"ktor-test-base",
)
// Point old artifact to new location
extra["relocatedArtifacts"] = mapOf(
"ktor-server-test-base" to "ktor-server-test-host",
)
extra["nonDefaultProjectStructure"] = mutableListOf(
"ktor-bom",
"ktor-java-modules-test",
)
apply(from = "gradle/compatibility.gradle")
plugins {
id("ktorbuild.base")
alias(libs.plugins.binaryCompatibilityValidator)
conventions.gradleDoctor
}
println("Build version: ${project.version}")
subprojects {
apply(plugin = "ktorbuild.base")
extra["hostManager"] = HostManager()
setupTrainForSubproject()
val nonDefaultProjectStructure: List<String> by rootProject.extra
if (nonDefaultProjectStructure.contains(project.name)) return@subprojects
apply(plugin = "ktorbuild.kmp")
apply(plugin = "atomicfu-conventions")
if (CI) configureTestTasksOnCi()
kotlin {
if (!internalProjects.contains(project.name)) explicitApi()
compilerOptions {
languageVersion = getKotlinLanguageVersion()
apiVersion = getKotlinApiVersion()
progressiveMode = true
}
}
if (!internalProjects.contains(project.name)) {
configurePublication()
}
configureCodestyle()
}
println("Using Kotlin compiler version: ${libs.versions.kotlin.get()}")
filterSnapshotTests()
fun configureDokka() {
allprojects {
plugins.apply("ktorbuild.dokka")
}
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().ignoreScripts = false
}
}
configureDokka()
subprojects {
tasks.withType<KotlinCompilationTask<*>>().configureEach {
configureCompilerOptions()
}
}