This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
forked from BetterCloud/vault-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
166 lines (142 loc) · 4.83 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
group 'com.bettercloud'
archivesBaseName = 'vault-java-driver'
version '1.2.0-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
testCompile('junit:junit:4.11')
testCompile('org.mockito:mockito-core:1.10.19')
testCompile('org.eclipse.jetty:jetty-server:9.3.7.v20160115')
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
//
// Separate unit tests from integration tests. See: `src/test-integration/README.md`
//
configurations {
unitTestsCompile.extendsFrom testCompile
unitTestsRuntime.extendsFrom testRuntime
integrationTestsCompile.extendsFrom testCompile
integrationTestsRuntime.extendsFrom testRuntime
}
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')
}
}
task unitTest(type: Test) {
testClassesDir = sourceSets.unitTests.output.classesDir
classpath = sourceSets.unitTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTests.output.classesDir
classpath = sourceSets.integrationTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
systemProperties = [
VAULT_ADDR: System.getProperty("VAULT_ADDR"),
VAULT_TOKEN: System.getProperty("VAULT_TOKEN"),
VAULT_APP_ID: System.getProperty("VAULT_APP_ID"),
VAULT_USER_ID: System.getProperty("VAULT_USER_ID"),
VAULT_PASSWORD: System.getProperty("VAULT_PASSWORD")
]
}
//
// 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 = ''
}
if (!hasProperty('nexusUrl')) {
ext.nexusUrl = ''
}
if (!hasProperty('nexusUsername')) {
ext.nexusUsername = ''
}
if (!hasProperty('nexusPassword')) {
ext.nexusPassword = ''
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }
snapshotRepository(url: nexusUrl) {
authentication(userName: nexusUsername, password: nexusPassword)
}
pom.project {
name 'vault-java-driver'
packaging 'jar'
// optionally artifactId can be defined here
description 'Zero-dependency Java client for HashiCorp\'s Vault'
url 'https://github.com/BetterCloud/vault-java-driver'
scm {
connection 'https://github.com/BetterCloud/vault-java-driver.git'
developerConnection 'https://github.com/BetterCloud/vault-java-driver.git'
url 'https://github.com/BetterCloud/vault-java-driver'
}
licenses {
license {
name 'MIT'
url 'https://github.com/BetterCloud/vault-java-driver/blob/master/README.md'
}
}
developers {
developer {
id 'steve-perkins-bc'
name 'Steve Perkins'
email 'steve.perkins@bettercloud.com'
}
}
}
}
}
}