Skip to content

Commit

Permalink
Merge pull request #1232 from jakubriegel/#1159-rewrute-readme-exampl…
Browse files Browse the repository at this point in the history
…es-build-gradle-build-gradle-kts

rewrite readme-examples/build.gradle to build.gradle.kts
  • Loading branch information
robstoll authored Oct 21, 2022
2 parents a80ab67 + 75c367f commit ce439b5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 37 deletions.
37 changes: 0 additions & 37 deletions misc/tools/readme-examples/build.gradle

This file was deleted.

50 changes: 50 additions & 0 deletions misc/tools/readme-examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
description = "Runs examples, includes the code and the output in README.md"

val junitPlatformVersion: String by rootProject.extra
val spekVersion: String by rootProject.extra
val kotlinVersion: String by rootProject.extra
val niokVersion: String by rootProject.extra

kotlin {
sourceSets {
val main by getting {
dependencies {
implementation("org.junit.platform:junit-platform-console-standalone:$junitPlatformVersion")
implementationWithExclude("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
implementationWithExclude("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
implementationWithExclude("org.spekframework.spek2:spek-runtime-jvm:$spekVersion")
runtimeOnly("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")

implementation(prefixedProject("fluent-en_GB"))
implementationWithExclude("ch.tutteli.niok:niok:$niokVersion")
}
}
configureEach {
languageSettings.apply {
languageVersion = "1.3"
apiVersion = "1.3"
}
}
}
tasks {
register<JavaExec>("readme") {
group = "documentation"
description = "Runs examples, includes the code and the output in README.md"

classpath = project.sourceSets.main.get().runtimeClasspath
environment("README_SOURCETREE", "tree/main")

this.main = "org.junit.platform.console.ConsoleLauncher"
args = listOf(
"--scan-class-path", project.sourceSets.main.get().output.classesDirs.asPath,
"--disable-banner",
"--fail-if-no-tests",
"--include-engine", "spek2-readme",
"--details", "summary"
)
}
check {
dependsOn("readme")
}
}
}

0 comments on commit ce439b5

Please sign in to comment.