-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
139 lines (115 loc) · 3.44 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import java.io.BufferedReader
plugins {
kotlin("jvm") version "2.1.0"
id("org.jetbrains.dokka") version "2.0.0"
`maven-publish`
}
group = "org.veupathdb.vdi"
version = "15.0.0"
description = "Common components for VDI projects"
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/veupathdb/maven-packages")
credentials {
username = if (extra.has("gpr.user")) extra["gpr.user"] as String? else System.getenv("GITHUB_USERNAME")
password = if (extra.has("gpr.key")) extra["gpr.key"] as String? else System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation(libs.json)
implementation(libs.ldap)
implementation(libs.coroutines)
implementation(libs.compression)
testImplementation(libs.junit.api)
testRuntimeOnly(libs.junit.engine)
testImplementation(libs.mockito)
}
tasks.test {
useJUnitPlatform()
testLogging {
events(
TestLogEvent.FAILED,
TestLogEvent.STANDARD_OUT,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.PASSED
)
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.AMAZON
}
}
java {
withSourcesJar()
}
val docVersion = with(project.version as String) { substring(0, lastIndexOf('.')) } + ".0"
val dokkaPath = "docs/dokka/$docVersion"
val updateReadme = tasks.register("update-readme-version") {
with(ProcessBuilder("sed", "-i", "s/:lib-version: .\\+/:lib-version: ${project.version}/;s/:lib-feature: .\\+/:lib-feature: $docVersion/", "readme.adoc").start()) {
require(waitFor() == 0) { "failed to update readme!\n" + errorStream.bufferedReader().use(BufferedReader::readText) }
}
}
tasks.dokkaHtml {
outputDirectory.set(file(dokkaPath))
finalizedBy(updateReadme)
}
val javadocJar = tasks.register<Jar>("javadocJar") {
dependsOn(tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from(file(dokkaPath))
}
tasks.withType<Jar> {
enabled = true
}
publishing {
repositories {
maven {
name = "GitHub"
url = uri("https://maven.pkg.github.com/VEuPathDB/vdi-component-common")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("gpr") {
from(components["java"])
artifact(javadocJar)
pom {
name.set("vdi-component-common")
description.set(project.description)
url.set("https://github.com/VEuPathDB/vdi-component-common")
licenses {
license {
name.set("Apache-2.0")
}
}
developers {
developer {
id.set("epharper")
name.set("Elizabeth Paige Harper")
email.set("[email protected]")
url.set("https://github.com/foxcapades")
}
}
scm {
connection.set("scm:git:git://github.com/VEuPathDB/vdi-component-common.git")
developerConnection.set("scm:git:ssh://github.com/VEuPathDB/vdi-component-common.git")
url.set("https://github.com/VEuPathDB/vdi-component-common")
}
}
}
}
}