-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
55 lines (44 loc) · 1.25 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
id("com.github.johnrengelman.shadow")
id("com.dorongold.task-tree") version "1.5"
}
group = "ru.emkn"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
val junitVersion = "5.6.2"
implementation(kotlin("stdlib"))
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation(kotlin("test"))
}
tasks.withType(KotlinCompile::class.java) {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.shadowJar {
archiveBaseName.set("runnable")
archiveClassifier.set("")
mergeServiceFiles()
manifest {
attributes["Main-Class"] = "ru.emkn.p2beer.MainKt"
}
}
val runJar by tasks.creating(Exec::class) {
dependsOn(tasks.shadowJar)
val argvString = project.findProperty("argv") as String? ?: ""
val jarFile = tasks.shadowJar.get().outputs.files.singleFile
val evalArgs = listOf("java", "-jar", jarFile.absolutePath) + argvString.split(" ")
commandLine(*evalArgs.toTypedArray())
}