-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
61 lines (50 loc) Β· 1.56 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
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.4.30"
}
allprojects {
group = "git.kata"
version = "1.0"
repositories { mavenLocal(); jcenter() }
}
subprojects {
when (name) {
"exercise" -> {
/* π¨ Kotlin build */
apply(plugin = "org.jetbrains.kotlin.jvm")
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
}
sourceSets.getByName("main") {
withConvention(KotlinSourceSet::class) {
kotlin.srcDirs("src/")
}
}
/* β Unit Tests with JUnit5 */
dependencies {
testImplementation(platform("org.junit:junit-bom:5.7.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.test {
useJUnitPlatform { excludeEngines("junit-vintage") }
}
sourceSets.getByName("test") {
withConvention(KotlinSourceSet::class) {
kotlin.srcDirs("test/")
}
}
}
else -> /* π Custom tasks */ tasks {
register<Exec>("${project.name}-init") {
group = "kata-exercises"
commandLine("sh", "./init.sh")
}
}
}
}
/* π Gradle wrapper */
tasks.withType<Wrapper> {
gradleVersion = "6.8"
distributionType = Wrapper.DistributionType.BIN
}