Skip to content

Commit ed22312

Browse files
authored
Update integration tests for kotlinx libraries and add new ones (#4107)
1 parent cddd735 commit ed22312

File tree

11 files changed

+562
-258
lines changed

11 files changed

+562
-258
lines changed

dokka-integration-tests/gradle/build.gradle.kts

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,37 @@ registerTestProjectSuite("testTemplateProjectTasksExecutionStress", "it-sequenti
110110
registerTestProjectSuite("testTemplateProjectWasmBasic", "it-wasm-basic")
111111
registerTestProjectSuite("testTemplateProjectWasmJsWasiBasic", "it-wasm-js-wasi-basic")
112112

113+
registerTestProjectSuite(
114+
"testExternalProjectKotlinxIo",
115+
"io/kotlinx-io",
116+
jvm = JavaLanguageVersion.of(8)
117+
) {
118+
targets.configureEach {
119+
testTask.configure {
120+
dependsOn(checkoutKotlinxIo)
121+
// register the whole directory as an input because it contains the git diff
122+
inputs
123+
.dir(templateProjectsDir.file("io"))
124+
.withPropertyName("ioProjectDir")
125+
}
126+
}
127+
}
128+
129+
registerTestProjectSuite(
130+
"testExternalProjectKotlinxDatetime",
131+
"datetime/kotlinx-datetime",
132+
jvm = JavaLanguageVersion.of(8)
133+
) {
134+
targets.configureEach {
135+
testTask.configure {
136+
dependsOn(checkoutKotlinxDatetime)
137+
// register the whole directory as an input because it contains the git diff
138+
inputs
139+
.dir(templateProjectsDir.file("datetime"))
140+
.withPropertyName("datetimeProjectDir")
141+
}
142+
}
143+
}
113144
registerTestProjectSuite(
114145
"testExternalProjectKotlinxCoroutines",
115146
"coroutines/kotlinx-coroutines",
@@ -203,15 +234,25 @@ testing.suites.named<JvmTestSuite>("test") {
203234
}
204235
}
205236

237+
val checkoutKotlinxDatetime by tasks.registering(GitCheckoutTask::class) {
238+
uri = "https://github.com/Kotlin/kotlinx-datetime.git"
239+
commitId = "4dadf6fbe4956a1a846cab0dc9282cfef1aeac23"
240+
destination = templateProjectsDir.dir("datetime/kotlinx-datetime")
241+
}
242+
val checkoutKotlinxIo by tasks.registering(GitCheckoutTask::class) {
243+
uri = "https://github.com/Kotlin/kotlinx-io.git"
244+
commitId = "8950a88f0d00ca2d23ad39db423a97840eea9dc2"
245+
destination = templateProjectsDir.dir("io/kotlinx-io")
246+
}
206247
val checkoutKotlinxCoroutines by tasks.registering(GitCheckoutTask::class) {
207248
uri = "https://github.com/Kotlin/kotlinx.coroutines.git"
208-
commitId = "b78bbf518bd8e90e9ed2133ebdacc36441210cd6"
249+
commitId = "f4f519b36734238ec686dfaec1e174086691781e"
209250
destination = templateProjectsDir.dir("coroutines/kotlinx-coroutines")
210251
}
211252

212253
val checkoutKotlinxSerialization by tasks.registering(GitCheckoutTask::class) {
213254
uri = "https://github.com/Kotlin/kotlinx.serialization.git"
214-
commitId = "ed1b05707ec27f8864c8b42235b299bdb5e0015c"
255+
commitId = "4667a1891a925dc9e3e10490c274a875b0be4da6"
215256
destination = templateProjectsDir.dir("serialization/kotlinx-serialization")
216257
}
217258

Lines changed: 101 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,75 @@
1-
diff --git a/build.gradle b/build.gradle
2-
index e7d405e12..db5dcec66 100644
3-
--- a/build.gradle
4-
+++ b/build.gradle
5-
@@ -52,17 +52,27 @@ buildscript {
1+
diff --git a/build.gradle.kts b/build.gradle.kts
2+
index 7b9248ca4..db61bb7b2 100644
3+
--- a/build.gradle.kts
4+
+++ b/build.gradle.kts
5+
@@ -5,15 +5,16 @@ import org.gradle.kotlin.dsl.*
6+
buildscript {
7+
if (shouldUseLocalMaven(rootProject)) {
8+
repositories {
9+
- mavenLocal()
10+
+ // mavenLocal()
11+
}
612
}
713

814
repositories {
915
+ /* %{DOKKA_IT_MAVEN_REPO}% */
1016
mavenCentral()
11-
maven { url "https://plugins.gradle.org/m2/" }
12-
CommunityProjectsBuild.addDevRepositoryIfEnabled(delegate, project)
17+
maven(url = "https://plugins.gradle.org/m2/")
18+
addDevRepositoryIfEnabled(this, project)
1319
- mavenLocal()
14-
+ //mavenLocal()
20+
+ // mavenLocal()
1521
}
1622

1723
dependencies {
18-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19-
- classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
20-
+ classpath "org.jetbrains.dokka:dokka-gradle-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}"
21-
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version"
22-
- classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version"
23-
+ classpath("org.jetbrains.kotlinx:kotlinx-knit:$knit_version") {
24-
+ exclude(group: "org.jetbrains.kotlinx", module: "dokka-pathsaver-plugin")
24+
@@ -21,8 +22,16 @@ buildscript {
25+
// The corresponding issue in kotlinx-atomicfu: https://github.com/Kotlin/kotlinx-atomicfu/issues/384
26+
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${version("atomicfu")}")
27+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${version("kotlin")}")
28+
- classpath("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}")
29+
- classpath("org.jetbrains.kotlinx:kotlinx-knit:${version("knit")}")
30+
+ classpath("org.jetbrains.dokka:dokka-gradle-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
31+
+ classpath("org.jetbrains.kotlinx:kotlinx-knit:${version("knit")}") {
32+
+ exclude("org.jetbrains.kotlinx", "dokka-pathsaver-plugin")
2533
+ }
26-
+ classpath("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") {
27-
+ exclude(group: "org.jetbrains.dokka", module: "templating-plugin")
28-
+ exclude(group: "org.jetbrains.dokka", module: "dokka-base")
34+
+ classpath("org.jetbrains.kotlinx:dokka-pathsaver-plugin:${version("knit")}") {
35+
+ exclude("org.jetbrains.dokka", "templating-plugin")
36+
+ exclude("org.jetbrains.dokka", "dokka-base")
2937
+ }
3038
+ classpath("org.jetbrains.dokka:templating-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
3139
+ classpath("org.jetbrains.dokka:dokka-base:${providers.gradleProperty("dokka_it_dokka_version").get()}")
32-
+
33-
classpath "com.github.node-gradle:gradle-node-plugin:$gradle_node_version"
34-
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version"
35-
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.5.4" // Android API check
36-
@@ -102,11 +112,11 @@ allprojects {
37-
kotlin_version = rootProject.properties['kotlin_snapshot_version']
38-
}
40+
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:${version("binary_compatibility_validator")}")
41+
classpath("ru.vyarus:gradle-animalsniffer-plugin:${version("animalsniffer")}") // Android API check
42+
classpath("org.jetbrains.kotlin:atomicfu:${version("kotlin")}")
43+
@@ -48,7 +57,7 @@ allprojects {
3944

40-
- if (using_snapshot_version) {
41-
- repositories {
45+
if (shouldUseLocalMaven(rootProject)) {
46+
repositories {
4247
- mavenLocal()
43-
- }
44-
- }
45-
+ //if (using_snapshot_version) {
46-
+ // repositories {
47-
+ // mavenLocal()
48-
+ // }
49-
+ //}
50-
51-
ext.unpublished = unpublished
48+
+ // mavenLocal()
49+
}
50+
}
5251

53-
@@ -135,6 +145,7 @@ apiValidation {
52+
@@ -84,6 +93,7 @@ apiValidation {
5453
// Configure repositories
5554
allprojects {
5655
repositories {
5756
+ /* %{DOKKA_IT_MAVEN_REPO}% */
5857
/*
5958
* google should be first in the repository list because some of the play services
6059
* transitive dependencies was removed from jcenter, thus breaking gradle dependency resolution
61-
@@ -323,7 +334,12 @@ knit {
62-
knitPrepare.dependsOn getTasksByName("dokkaHtmlMultiModule", true)
63-
64-
dependencies {
65-
- dokkaHtmlMultiModulePlugin("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version")
66-
+ dokkaHtmlMultiModulePlugin("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") {
67-
+ exclude(group: "org.jetbrains.dokka", module: "templating-plugin")
68-
+ exclude(group: "org.jetbrains.dokka", module: "dokka-base")
69-
+ }
70-
+ dokkaHtmlMultiModulePlugin("org.jetbrains.dokka:templating-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
71-
+ dokkaHtmlMultiModulePlugin("org.jetbrains.dokka:dokka-base:${providers.gradleProperty("dokka_it_dokka_version").get()}")
72-
}
73-
74-
// Opt-in for build scan in order to troubleshoot Gradle on TC
7560
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
76-
index ae54ad0f6..00963f5b2 100644
61+
index 27b713684..e92c4d725 100644
7762
--- a/buildSrc/build.gradle.kts
7863
+++ b/buildSrc/build.gradle.kts
79-
@@ -13,6 +13,7 @@ val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoole
64+
@@ -9,6 +9,7 @@ val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoole
8065
val kotlinDevUrl = project.rootProject.properties["kotlin_repo_url"] as? String
8166

8267
repositories {
8368
+ /* %{DOKKA_IT_MAVEN_REPO}% */
8469
mavenCentral()
8570
if (cacheRedirectorEnabled) {
8671
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
87-
@@ -22,9 +23,9 @@ repositories {
88-
if (!kotlinDevUrl.isNullOrEmpty()) {
89-
maven(kotlinDevUrl)
90-
}
91-
- if (buildSnapshotTrain) {
92-
- mavenLocal()
93-
- }
94-
+ //if (buildSnapshotTrain) {
95-
+ // mavenLocal()
96-
+ //}
97-
}
98-
99-
val gradleProperties = Properties().apply {
100-
@@ -49,12 +50,12 @@ dependencies {
72+
@@ -45,12 +46,12 @@ dependencies {
10173
* our version of Gradle bundles Kotlin 1.4.x and can read metadata only up to 1.5.x,
10274
* thus we're excluding stdlib compiled with 1.6.0 from dependencies.
10375
*/
@@ -112,73 +84,93 @@ index ae54ad0f6..00963f5b2 100644
11284
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
11385
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
11486
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
87+
@@ -64,6 +65,9 @@ dependencies {
88+
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
89+
}
90+
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:${version("benchmarks")}")
91+
- implementation("org.jetbrains.kotlinx:kotlinx-knit:${version("knit")}")
92+
+ implementation("org.jetbrains.kotlinx:kotlinx-knit:${version("knit")}") {
93+
+ exclude("org.jetbrains.dokka", "templating-plugin")
94+
+ exclude("org.jetbrains.dokka", "dokka-base")
95+
+ }
96+
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${version("atomicfu")}")
97+
}
11598
diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts
116-
index c2e859f65..9cc749a1f 100644
99+
index 2ad2ddbea..98eb05e0f 100644
117100
--- a/buildSrc/settings.gradle.kts
118101
+++ b/buildSrc/settings.gradle.kts
119-
@@ -4,6 +4,7 @@
102+
@@ -1,6 +1,7 @@
120103
pluginManagement {
121104
val build_snapshot_train: String? by settings
122105
repositories {
123106
+ /* %{DOKKA_IT_MAVEN_REPO}% */
124107
val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true
125108
if (cacheRedirectorEnabled) {
126109
println("Redirecting repositories for buildSrc buildscript")
127-
@@ -11,8 +12,8 @@ pluginManagement {
128-
} else {
110+
@@ -9,7 +10,7 @@ pluginManagement {
129111
maven("https://plugins.gradle.org/m2")
130112
}
131-
- if (build_snapshot_train?.toBoolean() == true) {
113+
if (build_snapshot_train?.toBoolean() == true) {
132114
- mavenLocal()
133-
- }
134-
+ //if (build_snapshot_train?.toBoolean() == true) {
135-
+ // mavenLocal()
136-
+ //}
115+
+ // mavenLocal()
116+
}
117+
}
118+
}
119+
diff --git a/buildSrc/src/main/kotlin/dokka-conventions.gradle.kts b/buildSrc/src/main/kotlin/dokka-conventions.gradle.kts
120+
index 966aa98e0..98f131768 100644
121+
--- a/buildSrc/src/main/kotlin/dokka-conventions.gradle.kts
122+
+++ b/buildSrc/src/main/kotlin/dokka-conventions.gradle.kts
123+
@@ -25,14 +25,25 @@ tasks.withType<DokkaMultiModuleTask>().named("dokkaHtmlMultiModule") {
124+
125+
dependencies {
126+
// Add explicit dependency between Dokka and Knit plugin
127+
- add("dokkaHtmlMultiModulePlugin", "org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version")
128+
+ add("dokkaHtmlMultiModulePlugin", "org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") {
129+
+ exclude("org.jetbrains.dokka", "templating-plugin")
130+
+ exclude("org.jetbrains.dokka", "dokka-base")
131+
+ }
132+
+ add("dokkaHtmlMultiModulePlugin", "org.jetbrains.dokka:templating-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
133+
+ add("dokkaHtmlMultiModulePlugin", "org.jetbrains.dokka:dokka-base:${providers.gradleProperty("dokka_it_dokka_version").get()}")
134+
}
135+
136+
// Dependencies for Knit processing: Knit plugin to work with Dokka
137+
private fun Project.configurePathsaver() {
138+
tasks.withType(DokkaTaskPartial::class).configureEach {
139+
dependencies {
140+
- plugins("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version")
141+
+ val knit_version: String by project
142+
+ plugins("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") {
143+
+ exclude(group = "org.jetbrains.dokka", module = "templating-plugin")
144+
+ exclude(group = "org.jetbrains.dokka", module = "dokka-base")
145+
+ }
146+
+ plugins("org.jetbrains.dokka:templating-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
147+
+ plugins("org.jetbrains.dokka:dokka-base:${providers.gradleProperty("dokka_it_dokka_version").get()}")
148+
}
137149
}
138150
}
139151
diff --git a/gradle.properties b/gradle.properties
140-
index 3d9431be0..9af01ef86 100644
152+
index 7af5770c3..aa5f53f9b 100644
141153
--- a/gradle.properties
142154
+++ b/gradle.properties
143-
@@ -14,7 +14,7 @@ atomicfu_version=0.21.0
144-
knit_version=0.5.0-Beta
145-
html_version=0.7.2
155+
@@ -12,7 +12,7 @@ junit_version=4.12
156+
junit5_version=5.7.0
157+
knit_version=0.5.0
146158
lincheck_version=2.18.1
147-
-dokka_version=1.8.10
159+
-dokka_version=2.0.0
148160
+dokka_version=non-existing-sanity-check-SNAPSHOT
149161
byte_buddy_version=1.10.9
150162
reactor_version=3.4.1
151-
reactive_streams_version=1.0.3
152-
diff --git a/gradle/dokka.gradle.kts b/gradle/dokka.gradle.kts
153-
index ba6956aa8..4a5d27e1a 100644
154-
--- a/gradle/dokka.gradle.kts
155-
+++ b/gradle/dokka.gradle.kts
156-
@@ -21,7 +21,13 @@ fun GradleDokkaSourceSetBuilder.makeLinkMapping(projectDir: File) {
157-
val knit_version: String by project
158-
tasks.withType(DokkaTaskPartial::class).configureEach {
159-
dependencies {
160-
- plugins("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version")
161-
+ val knit_version: String by project
162-
+ plugins("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") {
163-
+ exclude(group = "org.jetbrains.dokka", module = "templating-plugin")
164-
+ exclude(group = "org.jetbrains.dokka", module = "dokka-base")
165-
+ }
166-
+ plugins("org.jetbrains.dokka:templating-plugin:${providers.gradleProperty("dokka_it_dokka_version").get()}")
167-
+ plugins("org.jetbrains.dokka:dokka-base:${providers.gradleProperty("dokka_it_dokka_version").get()}")
168-
}
169-
}
170-
171-
diff --git a/settings.gradle b/settings.gradle
172-
index 151c087fd..e4433c24f 100644
173-
--- a/settings.gradle
174-
+++ b/settings.gradle
175-
@@ -9,7 +9,8 @@ pluginManagement {
163+
reactor_docs_version=3.4.5
164+
diff --git a/settings.gradle.kts b/settings.gradle.kts
165+
index 423c613f3..7bcebfa6d 100644
166+
--- a/settings.gradle.kts
167+
+++ b/settings.gradle.kts
168+
@@ -6,7 +6,7 @@ pluginManagement {
176169
}
177170

178171
repositories {
179-
- maven { url "https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/" }
180-
+ /* %{DOKKA_IT_MAVEN_REPO}% */
181-
+ //maven { url "https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/" }
172+
- maven(url = "https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/")
173+
+ //maven(url = "https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/")
182174
gradlePluginPortal()
183175
}
184176
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# kotlinx-datetime is automatically downloaded with a Gradle task
2+
kotlinx-datetime/

0 commit comments

Comments
 (0)