-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
95 lines (85 loc) · 2.5 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
plugins {
id("java-library")
alias(libs.plugins.jetbrains.kotlin.jvm)
alias(libs.plugins.kotlinter)
id("jacoco")
alias(libs.plugins.git.version) // https://stackoverflow.com/a/71212144
alias(libs.plugins.sonatype.maven.central)
alias(libs.plugins.gradleup.nmcp)
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlin {
jvmToolchain(21)
}
tasks.jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
}
jacoco {
toolVersion = "0.8.12"
}
dependencies {
api(libs.slf4j.api)
api(libs.icmp.common)
implementation(libs.packetdumper)
testImplementation(libs.bundles.test)
testRuntimeOnly(libs.junit.jupiter.engine)
testImplementation(libs.logback.classic)
}
version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
refs {
branch(".+") { version = "\${ref}-SNAPSHOT" }
tag("v(?<version>.*)") { version = "\${ref.version}" }
}
}
// see: https://github.com/vanniktech/gradle-maven-publish-plugin/issues/747#issuecomment-2066762725
// and: https://github.com/GradleUp/nmcp
nmcp {
val props = project.properties
publishAllPublications {
username = props["centralPortalToken"] as String? ?: ""
password = props["centralPortalPassword"] as String? ?: ""
// or if you want to publish automatically
publicationType = "AUTOMATIC"
}
}
// see: https://vanniktech.github.io/gradle-maven-publish-plugin/central/#configuring-the-pom
mavenPublishing {
coordinates("com.jasonernst.knet", "knet", version.toString())
pom {
name = "knet"
description = "A kotlin user-space networking library."
inceptionYear = "2024"
url = "https://github.com/compscidr/knet"
licenses {
license {
name = "GPL-3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
distribution = "repo"
}
}
developers {
developer {
id = "compscidr"
name = "Jason Ernst"
url = "https://www.jasonernst.com"
}
}
scm {
url = "https://github.com/compscidr/knet"
connection = "scm:git:git://github.com/compscidr/knet.git"
developerConnection = "scm:git:ssh://[email protected]/compscidr/knet.git"
}
}
signAllPublications()
}