-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
50 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} | ||
} |