-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
89 lines (72 loc) · 2.12 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
82
83
84
85
86
87
88
89
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.0.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
application
jacoco
}
group = "eu.jameshamilton"
version = "2.0"
repositories {
mavenCentral()
}
dependencies {
implementation("com.guardsquare:proguard-core:9.1.4")
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.6")
implementation("org.apache.commons:commons-text:1.10.0")
compileOnly("org.jetbrains:annotations:22.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-test:2.0.0")
testImplementation("io.kotest:kotest-runner-junit5-jvm:5.9.1")
testImplementation("io.kotest:kotest-assertions-core-jvm:5.9.1")
testImplementation("io.kotest:kotest-property-jvm:5.9.1")
testImplementation("io.kotest:kotest-framework-datatest:5.9.1")
testImplementation("io.mockk:mockk:1.12.2")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
compilerOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
tasks.withType<Test> {
minHeapSize = "512m"
maxHeapSize = "2048m"
}
application {
mainClass.set("eu.jameshamilton.klox.MainKt")
}
ktlint {
enableExperimentalRules.set(true)
disabledRules.set(setOf("no-wildcard-imports", "experimental:argument-list-wrapping"))
}
tasks.register<Jar>("fatJar") {
archiveFileName.set("klox.jar")
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes["Main-Class"] = "eu.jameshamilton.klox.MainKt"
attributes["Implementation-Version"] = project.version
}
}
tasks.register<Copy>("copyJar") {
from(tasks.named("fatJar"))
into("$rootDir/lib")
}
tasks.named("build") {
finalizedBy(":copyJar")
}
tasks.named("clean") {
doFirst {
File("$rootDir/lib/klox.jar").delete()
}
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(true)
}
}