-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
63 lines (50 loc) · 1.61 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.jvm.tasks.Jar
plugins {
kotlin("jvm") version "1.4.32"
application
}
group = "com.example.boilerplate"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
// arrow-kt is considered an extension to the language
implementation("io.arrow-kt:arrow-core:0.13.2")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
testImplementation("org.assertj:assertj-core:3.19.0")
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events = setOf(
TestLogEvent.FAILED,TestLogEvent.PASSED,TestLogEvent.SKIPPED, TestLogEvent.STANDARD_OUT)
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
val fatJar = task("fatJar", type = Jar::class) {
baseName = "${project.name}-fat"
manifest {
attributes["Implementation-Title"] = "Gradle Jar File Example"
attributes["Implementation-Version"] = version
attributes["Main-Class"] = "com.example.boilerplate.Main"
}
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
with(tasks.jar.get() as CopySpec)
}
tasks {
"build" {
dependsOn(fatJar)
}
}