forked from BetterCloud/vault-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle
219 lines (192 loc) · 6.57 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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
plugins {
id 'java-library'
id 'signing'
id 'checkstyle'
id 'maven-publish'
}
group 'io.github.jopenlibs'
archivesBaseName = 'vault-java-driver'
version '6.2.0'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
mavenCentral()
}
dependencies {
testImplementation('junit:junit:4.13.2')
testImplementation('org.mockito:mockito-core:5.4.0')
testImplementation('org.testcontainers:testcontainers:1.19.1')
testImplementation('org.eclipse.jetty:jetty-server:11.0.15')
testImplementation('org.slf4j:slf4j-api:2.0.7')
testImplementation('org.bouncycastle:bcprov-jdk15on:1.70')
testImplementation('org.bouncycastle:bcpkix-jdk15on:1.70')
testImplementation('org.apache.commons:commons-io:1.3.2')
testRuntimeOnly('org.slf4j:slf4j-simple:2.0.5')
}
compileJava {
options.compilerArgs = ['--release', targetCompatibility.toString()]
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.register('javadocJar', Jar) {
dependsOn tasks.named("javadoc")
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
tasks.register('sourcesJar', Jar) {
dependsOn tasks.named("classes")
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
//
// Separate unit tests from integration tests. See: `src/test-integration/README.md`
//
sourceSets {
unitTests {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
java.srcDir file('src/test/java')
}
integrationTests {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
java.srcDir file('src/test-integration/java')
resources.srcDirs += file('src/test-integration/resources')
}
}
configurations {
unitTestsImplementation.extendsFrom testImplementation
unitTestsRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestsImplementation.extendsFrom testImplementation
integrationTestsRuntimeOnly.extendsFrom testRuntimeOnly
}
tasks.named('test') {
useJUnit()
testClassesDirs = sourceSets.unitTests.output.classesDirs
classpath = sourceSets.unitTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
reports {
html {
required = false
}
junitXml {
required = true
}
}
}
def integrationTestTask = tasks.register('integrationTest', Test) {
useJUnit()
testClassesDirs = sourceSets.integrationTests.output.classesDirs
classpath = sourceSets.integrationTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
reports {
html {
required = false
}
junitXml {
required = true
}
}
}
//
// Deploying releases to Maven Central (or snapshots to a local Nexus repository).
//
// Snapshots are not signed... but signing the release artifact requires the following project properties:
//
// signing.keyId = <ID of the private key in your secure keyring used for signing JAR's>
// signing.password = <public key password>
// signing.secretKeyRingFile = <full path to your keyring file (i.e secring.gpg)>
//
if (!hasProperty('ossrhUsername')) {
ext.ossrhUsername = ''
}
if (!hasProperty('ossrhPassword')) {
ext.ossrhPassword = ''
}
artifacts {
archives javadocJar, sourcesJar
}
java {
withSourcesJar()
withJavadocJar()
}
if (hasProperty("publish")) {
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'vault-java-driver'
from components.java
pom {
name = 'vault-java-driver'
packaging = 'jar'
description = 'Zero-dependency Java client for HashiCorp\'s Vault'
url = 'https://github.com/jopenlibs/vault-java-driver'
scm {
connection = 'https://github.com/jopenlibs/vault-java-driver.git'
developerConnection = 'https://github.com/jopenlibs/vault-java-driver.git'
url = 'https://github.com/jopenlibs/vault-java-driver'
}
licenses {
license {
name = 'MIT'
url = 'https://github.com/jopenlibs/vault-java-driver/blob/master/README.md#license'
}
}
developers {
[
developer {
id = 'steve-perkins'
name = 'Steve Perkins'
email = '[email protected]'
},
developer {
id = 'steve-perkins-bc'
name = 'Steve Perkins'
email = '[email protected]'
},
developer {
id = 'jarrodcodes'
name = 'Jarrod Young'
email = '[email protected]'
},
developer {
id = 'tledkov'
name = 'Taras Ledkov'
email = '[email protected]'
},
developer {
id = 'henryx'
name = 'Enrico Bianchi'
email = '[email protected]'
}
]
}
}
}
}
repositories {
maven {
credentials {
username "$ossrhUsername"
password "$ossrhPassword"
}
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}