-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
73 lines (60 loc) · 1.52 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
plugins {
kotlin("jvm") version "1.9.0"
id("org.jetbrains.dokka") version "1.8.20"
application
`maven-publish`
}
group = "org.modbuskt"
version = "1.0.0"
repositories {
mavenCentral()
}
val log4jVersion = "2.12.1"
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation(kotlin("test"))
implementation("io.netty:netty-all:4.1.104.Final")
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")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(11)
}
//application {
// mainClass.set("MainKt")
//}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}
}
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "MainKt"
}
// To avoid the duplicate handling strategy error
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// To add all of the dependencies
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.paulorb"
artifactId = "modbus-kt"
version = "1.0.0"
from(components["java"])
}
}
}