4
4
5
5
@file:Suppress(" UnstableApiUsage" )
6
6
7
- /*
8
- * These properties are used to build Ktor against Kotlin compiler snapshot in two different configurations:
9
- *
10
- * Ktor K2:
11
- * - `kotlin_version overrides` the Kotlin version to be used for project compilation
12
- * - `kotlin_repo_url` defines additional repository to be added to the repository list
13
- * - `kotlin_language_version` overrides Kotlin language versions
14
- * - `kotlin_api_version` overrides Kotlin API version
15
- *
16
- * Ktor Train:
17
- * All the above properties are applied, and:
18
- * - `build_snapshot_train` is set to true
19
- * - `atomicfu_version`, `coroutines_version` and `serialization_version` are defined in TeamCity environment
20
- * - Additionally Sonatype snapshots repository added to the repository list,
21
- * and stress tests disabled.
22
- *
23
- * DO NOT change the names of these properties without adapting kotlinx.train build chain.
24
- */
25
-
26
7
pluginManagement {
27
- // Share repositories configuration between pluginManagement and dependencyResolutionManagement blocks
28
- val configureRepositories by extra {
29
- val additionalKotlinRepo = providers.gradleProperty(" kotlin_repo_url" ).orNull
30
-
31
- fun RepositoryHandler .() {
32
- google {
33
- content {
34
- includeGroupAndSubgroups(" com.google" )
35
- includeGroupAndSubgroups(" com.android" )
36
- }
37
- }
38
- mavenCentral()
39
-
40
- if (additionalKotlinRepo != null ) {
41
- maven(additionalKotlinRepo) { name = " KotlinDevRepo" }
42
- logger.info(" Kotlin Dev repository: $additionalKotlinRepo " )
43
- }
44
-
45
- mavenLocal()
46
-
47
- exclusiveContent {
48
- forRepository {
49
- maven(" https://maven.pkg.jetbrains.space/public/p/ktor/eap" ) { name = " KtorEAP" }
50
- }
51
- filter { includeVersionByRegex(" io.ktor" , " .+" , " .+-eap-\\ d+" ) }
52
- }
53
- }
54
- }
55
-
56
8
repositories {
57
9
gradlePluginPortal()
58
10
configureRepositories()
59
11
}
60
12
}
61
13
62
- val configureRepositories: RepositoryHandler .() -> Unit by extra
63
- val buildSnapshotTrain = providers.gradleProperty(" build_snapshot_train" ).orNull.toBoolean()
64
- val kotlinVersion = providers.gradleProperty(" kotlin_version" )
65
- // kotlin_snapshot_version might be used instead of kotlin_version
66
- .orElse(providers.gradleProperty(" kotlin_snapshot_version" ))
67
- .orNull
68
-
69
14
dependencyResolutionManagement {
70
15
repositories {
71
16
configureRepositories()
@@ -77,25 +22,31 @@ dependencyResolutionManagement {
77
22
from(files(" ../gradle/libs.versions.toml" ))
78
23
}
79
24
80
- if (buildSnapshotTrain) {
81
- requireNotNull(kotlinVersion) {
82
- " kotlin_version should be specified when building with build_snapshot_train=true"
83
- }
84
- version(" kotlin" , kotlinVersion)
85
- version(" atomicfu" , extra[" atomicfu_version" ].toString())
86
- version(" coroutines" , extra[" coroutines_version" ].toString())
87
- version(" serialization" , extra[" serialization_version" ].toString())
88
- } else if (kotlinVersion != null ) {
89
- version(" kotlin" , kotlinVersion)
90
- }
91
-
92
25
downgradeTestDependencies()
93
26
}
94
27
}
95
28
}
96
29
97
- fun VersionCatalogBuilder.downgradeTestDependencies () {
30
+ private fun RepositoryHandler.configureRepositories () {
31
+ google {
32
+ content {
33
+ includeGroupAndSubgroups(" com.google" )
34
+ includeGroupAndSubgroups(" com.android" )
35
+ }
36
+ }
37
+ mavenCentral()
38
+ mavenLocal()
39
+
40
+ exclusiveContent {
41
+ forRepository {
42
+ maven(" https://maven.pkg.jetbrains.space/public/p/ktor/eap" ) { name = " KtorEAP" }
43
+ }
44
+ filter { includeVersionByRegex(" io.ktor" , " .+" , " .+-eap-\\ d+" ) }
45
+ }
46
+ }
47
+
48
+ private fun VersionCatalogBuilder.downgradeTestDependencies () {
98
49
val testJdk = providers.gradleProperty(" test.jdk" ).orNull?.toInt() ? : return
99
50
100
- if (testJdk < 11 ) version(" logback" , " 1.3.14" ) // Java 8 support dropped in Logback 1.4.x
51
+ if (testJdk < 11 ) version(" logback" , " 1.3.14" ) // Java 8 support has been dropped in Logback 1.4.x
101
52
}
0 commit comments