forked from Kotlin/kotlinx-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
69 lines (56 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
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.rpc) apply false
alias(libs.plugins.atomicfu) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.kover.root.project) apply false
alias(libs.plugins.binary.compatibility.validator)
}
object Const {
const val COMPILER_PLUGIN_MODULE_NAME = "kotlinx-rpc-compiler-plugin"
const val INTERNAL_RPC_API_ANNOTATION = "kotlinx.rpc.internal.InternalRPCApi"
}
apiValidation {
ignoredPackages.add("kotlinx.rpc.internal")
val compilerPluginModules = subprojects.single { it.name == Const.COMPILER_PLUGIN_MODULE_NAME }.let {
it.subprojects.map { sub -> sub.name }
} + Const.COMPILER_PLUGIN_MODULE_NAME
ignoredProjects.addAll(
listOf(
"codegen-tests-jvm",
"codegen-tests-mpp",
"kotlinx-rpc-runtime-test",
"kotlinx-rpc-utils",
"kotlinx-rpc-utils-service-loader",
"kotlinx-rpc-ksp-plugin",
) + compilerPluginModules
)
nonPublicMarkers.add(Const.INTERNAL_RPC_API_ANNOTATION)
}
val kotlinVersion: String by extra
if (kotlinVersion >= "1.8.0") {
apply(plugin = libs.plugins.kover.root.project.get().pluginId)
}
allprojects {
group = "org.jetbrains.kotlinx"
version = rootProject.libs.versions.rpc.full.get()
}
println("kotlinx.rpc project version: $version")
// If the prefix of the kPRC version is not Kotlin gradle plugin version - you have a problem :)
// Probably some dependency brings kotlin with higher version.
// To mitigate so, please refer to `gradle/kotlin-version-lookup.json`
// and it's usage in `gradle-settings-conventions/src/main/kotlin/settings-conventions.settings.gradle.kts`
val kotlinGPVersion = getKotlinPluginVersion()
if (!version.toString().startsWith(kotlinGPVersion)) {
error("KGP version mismatch. Project version: $version, KGP version: $kotlinGPVersion")
}
// necessary for CI js tests
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().ignoreScripts = false
}