-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
81 lines (68 loc) · 2.17 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
group = "dinkla.net"
version = "0.1-SNAPSHOT"
val junitVersion = "5.9.0"
val cucumberVersion = "7.8.1"
val cucumberReport = "pretty"
val kotlinxCoroutinesVersion = "1.7.3"
val kotestVersion = "5.8.0"
plugins {
kotlin("jvm") version "1.9.21"
id("io.kotest.multiplatform") version "5.4.2"
id("io.gitlab.arturbosch.detekt").version("1.23.4")
}
repositories {
mavenCentral()
maven {
url = URI.create("https://kotlin.bintray.com/kotlinx")
}
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
testImplementation(kotlin("test"))
testImplementation(kotlin("test-common"))
testImplementation(kotlin("test-annotations-common"))
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-framework-engine:$kotestVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
testImplementation("io.cucumber:cucumber-junit:$cucumberVersion")
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
configurations {}
val cucumberRuntime by configurations.creating {
extendsFrom(configurations["testImplementation"])
}
task("cucumber") {
dependsOn("assemble", "compileTestJava")
doLast {
javaexec {
mainClass = "io.cucumber.core.cli.Main"
classpath = cucumberRuntime + sourceSets.main.get().output + sourceSets.test.get().output
args =
listOf(
"--plugin",
cucumberReport,
"--glue",
"net.dinkla.raytracerchallenge.stepdefs",
"src/test/resources",
)
jvmArgs = listOf("-Dfile.encoding=utf-8", "-ea")
}
}
}
detekt {
source = files("src/main/kotlin", "src/test/kotlin")
config = files("detekt-config.yml")
}
task("pre_commit") {
dependsOn("test")
dependsOn("cucumber")
dependsOn("detekt")
}