-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
179 lines (155 loc) · 5.11 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
179 lines (155 loc) · 5.11 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
plugins {
`java-library`
checkstyle
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.jreleaser") version "1.25.0"
}
group = "uk.co.conoregan"
version = "2.6.1"
repositories {
mavenCentral()
}
dependencies {
// logging
implementation(platform("org.slf4j:slf4j-bom:2.0.18"))
implementation("org.slf4j:slf4j-api")
// testing
testImplementation(platform("org.junit:junit-bom:6.1.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher") // pin launcher to junit-bom; Gradle's bundled one lags the JUnit version
testImplementation(platform("org.mockito:mockito-bom:5.23.0"))
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
testImplementation("org.wiremock:wiremock:3.13.2")
// util
compileOnly("org.projectlombok:lombok:1.18.46")
annotationProcessor("org.projectlombok:lombok:1.18.46")
testCompileOnly("org.projectlombok:lombok:1.18.46")
testAnnotationProcessor("org.projectlombok:lombok:1.18.46")
implementation(platform("com.fasterxml.jackson:jackson-bom:2.21.3"))
implementation("com.fasterxml.jackson.core:jackson-annotations")
implementation("com.fasterxml.jackson.core:jackson-core")
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("org.apache.commons:commons-lang3:3.20.0")
testImplementation("commons-io:commons-io:2.22.0")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
}
tasks.test {
useJUnitPlatform {
excludeTags("integration")
}
}
tasks.register<Test>("integrationTest") {
description = "Runs integration tests (tagged with \"integration\")."
group = "verification"
useJUnitPlatform {
includeTags("integration")
}
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
shouldRunAfter(tasks.test)
}
tasks.check {
dependsOn("integrationTest")
}
checkstyle {
toolVersion = "10.17.0"
configFile = file("config/checkstyle/checkstyle.xml")
}
tasks.checkstyleMain {
source = fileTree("src/main/java")
}
tasks.checkstyleTest {
source = fileTree("src/test/java")
}
tasks.withType<Checkstyle>().configureEach {
reports {
html.required = true
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name = "themoviedbapi"
description = "A Java-wrapper around the JSON API provided by TMdB, which is an open database for movie and tv content."
url = "https://github.com/c-eg/themoviedbapi"
licenses {
license {
name = "BSD-2-Clause"
url = "https://github.com/c-eg/themoviedbapi/blob/master/LICENCE.txt"
}
}
scm {
connection = "scm:git:https://github.com/c-eg/themoviedbapi.git"
developerConnection = "scm:git:ssh://git@github.com/c-eg/themoviedbapi.git"
url = "https://github.com/c-eg/themoviedbapi"
}
developers {
developer {
id = "holgerbrandl"
name = "Holger Brandl"
email = "holgerbrandl@gmail.com"
}
developer {
id = "c-eg"
name = "Conor Egan"
email = "17conoregan@gmail.com"
}
}
}
}
}
repositories {
// Local staging dir that JReleaser reads from for the signed release deploy.
maven {
name = "staging"
url = uri(layout.buildDirectory.dir("staging-deploy"))
}
// Central Portal snapshot repository.
maven {
name = "centralSnapshots"
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
credentials {
username = providers.environmentVariable("MAVENCENTRAL_USERNAME").orNull
password = providers.environmentVariable("MAVENCENTRAL_PASSWORD").orNull
}
}
}
}
jreleaser {
signing {
pgp {
active = org.jreleaser.model.Active.ALWAYS
armored = true
mode = org.jreleaser.model.Signing.Mode.MEMORY
}
}
deploy {
maven {
mavenCentral {
create("sonatype") {
active = org.jreleaser.model.Active.ALWAYS
url.set("https://central.sonatype.com/api/v1/publisher")
stagingRepository("build/staging-deploy")
}
}
}
}
}
tasks.javadoc {
options {
(this as StandardJavadocDocletOptions).apply {
addBooleanOption("Xdoclint:none", true)
addBooleanOption("html5", true)
}
}
}