-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
96 lines (80 loc) · 2.21 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
90
91
92
93
94
95
96
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.kapt3.base.Kapt.kapt
plugins {
id ("org.jetbrains.kotlin.kapt") version "1.4.30"
id("com.github.johnrengelman.shadow") version "7.1.2"
kotlin("jvm") version "1.8.20"
application
jacoco
id ("org.sonarqube") version "3.5.0.2730"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven{
url = uri("https://jitpack.io")
}
}
val log4jVersion = "2.12.1"
dependencies {
kapt("info.picocli:picocli-codegen:4.6.1")
implementation ("info.picocli:picocli:4.6.1")
implementation("javax.xml.bind:jaxb-api:2.3.1")
implementation("com.sun.xml.bind:jaxb-core:2.3.0.1")
implementation("com.sun.xml.bind:jaxb-impl:2.3.3")
implementation ("com.github.paulorb:modbus-kt:1.0.18")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
implementation("org.apache.commons:commons-csv:1.10.0")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
testImplementation(kotlin("test"))
}
kapt {
arguments {
arg("project", "${project.group}/${project.name}")
}
}
val jar by tasks.getting(Jar::class) {
manifest {
attributes["Main-Class"] = "CheckSumKt"
}
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) {
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
}
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(11)
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(true)
}
}
application {
mainClass.set("MainKt")
}
tasks.jar {
manifest {
attributes["Main-Class"] = "MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks {
shadowJar {
mergeServiceFiles()
manifest {
attributes(
"Main-Class" to "org.example.MainKt"
)
}
}
}