-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
149 lines (132 loc) · 3.63 KB
/
build.gradle
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
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "jacoco"
id "idea"
id "com.adarshr.test-logger" version "4.0.0"
id "checkstyle"
id "com.github.spotbugs" version "6.0.27"
}
group "com.github.alexdlaird"
version "2.3.4"
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation "com.google.code.gson:gson:2.11.0"
implementation "org.yaml:snakeyaml:2.3"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.4"
testImplementation "org.mockito:mockito-core:5.14.2"
testImplementation "org.hamcrest:hamcrest:3.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.11.4"
}
tasks.register("createProperties", WriteProperties) {
outputFile new File(projectDir, "src/main/resources/version.properties")
property "version", version
finalizedBy sourcesJar
}
processResources.dependsOn createProperties
tasks.register("printVersion") {
doLast {
println(project.findProperty('rootProject').version)
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = "0.8.11"
}
jacocoTestReport {
reports {
xml.required = true
xml.destination file("build/reports/jacoco/report.xml")
}
}
checkstyle {
ignoreFailures = false
maxWarnings = 0
}
spotbugs {
excludeFilter = file("config/spotbugs/exclude.xml")
}
spotbugsMain {
reports {
html {
required = true
}
}
}
spotbugsTest {
reports {
html {
required = true
}
}
}
publishing {
publications {
javaLibrary(MavenPublication) {
from components.java
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name = Project.getName()
description = "A Java wrapper for ngrok"
url = "http://github.com/alexdlaird/java-ngrok"
licenses {
license {
name = "The MIT License (MIT)"
url = "https://github.com/alexdlaird/java-ngrok/blob/master/LICENSE"
distribution = "repo"
}
}
developers {
developer {
id = "alexdlaird"
name = "Alex Laird"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git://github.com/alexdlaird/java-ngrok.git"
developerConnection = "scm:git:ssh://github.com/alexdlaird/java-ngrok.git"
url = "http://github.com/alexdlaird/java-ngrok"
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
signing {
required { gradle.taskGraph.hasTask("publish") }
def signingKey = System.getenv("GPG_PRIVATE_KEY")
def signingPassword = System.getenv("GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.javaLibrary
}
javadoc {
options.overview = "src/main/java/overview.html"
options.addStringOption("Xdoclint:none", "-quiet")
options.addBooleanOption("html5", true)
}