forked from compscidr/kanonproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
107 lines (97 loc) · 3.09 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
97
98
99
100
101
102
103
104
105
106
107
plugins {
alias(libs.plugins.jetbrains.kotlin.jvm)
alias(libs.plugins.kotlinter)
id("java-library")
id("jacoco")
alias(libs.plugins.git.version)
alias(libs.plugins.sonatype.maven.central)
alias(libs.plugins.gradleup.nmcp)
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
tasks.jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
testLogging {
// get the test stdout / stderr to show up when we run gradle from command line
// https://itecnote.com/tecnote/gradle-how-to-get-output-from-test-stderr-stdout-into-console/
// https://developer.android.com/studio/test/advanced-test-setup
// https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html
outputs.upToDateWhen {true}
showStandardStreams = true
}
}
jacoco {
toolVersion = "0.8.12"
}
dependencies {
api(libs.slf4j.api)
api(libs.icmp.common)
implementation(libs.packetdumper)
implementation(libs.knet)
testImplementation(libs.icmp.linux)
testImplementation(libs.bundles.test)
testRuntimeOnly(libs.junit.jupiter.engine)
testImplementation(libs.logback.classic)
testImplementation(libs.testservers)
implementation(kotlin("stdlib"))
}
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.kanonproxy", "kanonproxy", version.toString())
pom {
name = "kanonproxy"
description = "An anonymous proxy written in kotlin."
inceptionYear = "2024"
url = "https://github.com/compscidr/kanonproxynet"
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/kanonproxy"
connection = "scm:git:git://github.com/compscidr/kanonproxy.git"
developerConnection = "scm:git:ssh://[email protected]/compscidr/kanonproxy.git"
}
}
signAllPublications()
}