Skip to content

Commit 80e346f

Browse files
authored
Merge pull request #456 from Kotlin/fix-samples-tests-compilation
Fix samples tests compilation
2 parents 3ce53d2 + eba27b1 commit 80e346f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

core/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ kotlin.sourceSets {
4646
}
4747

4848
sourceSets {
49+
// Gradle creates configurations and compilation task for each source set
4950
create("samples") {
5051
kotlin.srcDir("src/test/kotlin")
5152
}
@@ -79,7 +80,10 @@ val samplesImplementation by configurations.getting {
7980
}
8081

8182
val compileSamplesKotlin = tasks.named<KotlinCompile>("compileSamplesKotlin") {
82-
friendPaths.from(sourceSets["main"].output.classesDirs)
83+
tasks.named<KotlinCompile>("compileTestKotlin").get().let {
84+
friendPaths.from(it.friendPaths)
85+
libraries.from(it.libraries)
86+
}
8387
source(sourceSets["test"].kotlin)
8488
destinationDirectory.set(file("$buildDir/classes/testWithOutputs/kotlin"))
8589
}
@@ -103,7 +107,7 @@ val clearTestResults by tasks.creating(Delete::class) {
103107

104108
val samplesTest = tasks.register<Test>("samplesTest") {
105109
group = "Verification"
106-
description = "Runs the custom tests."
110+
description = "Runs all samples that are used in the documentation, but modified to save their outputs to a file."
107111

108112
dependsOn(compileSamplesKotlin)
109113
dependsOn(clearTestResults)

docs/StardustDocs/topics/joinWith.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ campaigns.innerJoinWith(visits) {
6868

6969
```kotlin
7070
campaigns.innerJoinWith(visits) {
71-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
71+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
7272
}
7373
```
7474

@@ -108,7 +108,7 @@ campaigns.filterJoinWith(visits) {
108108

109109
```kotlin
110110
campaigns.filterJoinWith(visits) {
111-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
111+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
112112
}
113113
```
114114

@@ -146,7 +146,7 @@ campaigns.leftJoinWith(visits) {
146146

147147
```kotlin
148148
campaigns.leftJoinWith(visits) {
149-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
149+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
150150
}
151151
```
152152

@@ -184,7 +184,7 @@ campaigns.rightJoinWith(visits) {
184184

185185
```kotlin
186186
campaigns.rightJoinWith(visits) {
187-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
187+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
188188
}
189189
```
190190

@@ -222,7 +222,7 @@ campaigns.fullJoinWith(visits) {
222222

223223
```kotlin
224224
campaigns.fullJoinWith(visits) {
225-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
225+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
226226
}
227227
```
228228

@@ -262,7 +262,7 @@ campaigns.excludeJoinWith(visits) {
262262

263263
```kotlin
264264
campaigns.excludeJoinWith(visits) {
265-
right[{ "date"<LocalDate>() }] in "startDate"<LocalDate>().."endDate"<LocalDate>()
265+
right.getValue<LocalDate>("date") in "startDate"<LocalDate>().."endDate"<LocalDate>()
266266
}
267267
```
268268

0 commit comments

Comments
 (0)