-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
126 lines (107 loc) · 3.2 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
plugins {
jacoco
`java-library`
`maven-publish`
signing
alias(libs.plugins.com.gradleup.nmcp)
alias(libs.plugins.ktfmt.gradle)
alias(libs.plugins.org.jetbrains.dokka)
alias(libs.plugins.org.jetbrains.kotlin.jvm)
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = "org.audux.bgg"
artifactId = "bggclient"
version = "0.5.1"
pom {
name = "Unofficial JVM BGG client"
description =
"Library to fetch data from the Board game geek (XML) APIs. Usable in Java and Kotlin on the JVM or Android."
url = "https://github.com/Bram--/bggclient"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http:https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "bram--"
name = "Bram Wijnands"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git:https://[email protected]:Bram--/bggclient.git"
developerConnection = "scm:git:ssh:[email protected]:Bram--/bggclient.git"
url = "https://github.com/Bram--/bggclient"
}
}
from(components["java"])
}
}
}
nmcp {
publish("mavenJava") {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
publicationType = "AUTOMATIC"
}
}
signing {
if (project.gradle.startParameter.taskNames.contains("publishAllPublicationsToCentralPortal")) {
afterEvaluate {
useInMemoryPgpKeys(
System.getenv("GPG_SIGNING_KEY"),
System.getenv("GPG_SIGNING_PASSWORD")
)
sign(publishing.publications["mavenJava"])
}
}
}
ktfmt {
kotlinLangStyle()
removeUnusedImports.set(true)
}
sourceSets { main { kotlin { exclude("examples/") } } }
repositories { mavenCentral() }
dependencies {
api(libs.kotlin.coroutines.jdk8)
implementation(libs.jackson.jsr310)
implementation(libs.jackson.kotlin)
implementation(libs.jackson.xml)
implementation(libs.javax.xml.stream)
implementation(libs.kermit)
implementation(libs.kotlin.serialization)
implementation(libs.ktor.core)
implementation(libs.ktor.client)
implementation(libs.slf4j)
// Testing dependencies.
testApi(libs.ktor.client.mock)
testImplementation(libs.junit5.jupiter)
testImplementation(libs.junit5.params)
testImplementation(libs.truth)
testRuntimeOnly(libs.junit5.engine)
}
jacoco {
toolVersion = "0.8.9"
reportsDirectory = layout.buildDirectory.dir("jacoco")
}
tasks {
test {
useJUnitPlatform()
finalizedBy(jacocoTestReport)
}
jacocoTestReport {
dependsOn(test)
reports {
xml.required.set(true)
html.required.set(true)
}
}
}