-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
165 lines (137 loc) · 5.85 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "com.jfrog.bintray" version "1.5"
}
group = 'org.bitsofinfo'
allprojects {
repositories {
jcenter()
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile group: 'com.hazelcast', name: 'hazelcast', version:"${hazelcast_version}"
compile group: 'com.orbitz.consul', name: 'consul-client', version:"${consul_client_version}"
compile group: 'commons-codec', name: 'commons-codec', version:"${commons_codec_version}"
// for consul-client
testCompile "org.apache.cxf:cxf-rt-rs-client:${cxf_rt_version}"
testCompile "org.apache.cxf:cxf-rt-transports-http-hc:${cxf_rt_version}"
testCompile "junit:junit:${junit_version}"
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('bintrayUser')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('bintrayApiKey')
publications = ['hazelcastConsulDiscoverySpi']
pkg {
repo = 'maven'
name = 'hazelcast-consul-discovery-spi'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/bitsofinfo/hazelcast-consul-discovery-spi'
publicDownloadNumbers = true
version {
name = project.property('version')
desc = project.property('version') + " : " + project.property('description')
released = new Date()
vcsTag = project.property('version')
}
}
}
publishing {
publications {
hazelcastConsulDiscoverySpi(MavenPublication) {
from components.java
groupId project.property('group')
artifactId 'hazelcast-consul-discovery-spi'
version project.property('version')
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().appendNode('name', project.property('group')+":hazelcast-consul-discovery-spi")
asNode().appendNode('description', project.property('description'))
asNode().appendNode('url', "https://github.com/bitsofinfo/hazelcast-consul-discovery-spi")
asNode().appendNode('packaging', "jar")
asNode().appendNode('licenses').appendNode('license')
.appendNode('name', "The Apache License, Version 2.0").parent()
.appendNode('url', "http://www.apache.org/licenses/LICENSE-2.0.txt")
asNode().appendNode('developers').appendNode('developer')
.appendNode('id', "bitsofinfo").parent()
.appendNode('name', "bitsofinfo").parent()
.appendNode('email', "[email protected]").parent()
.appendNode('organization',"bitsofinfo").parent()
.appendNode('organizationUrl','https://github.com/bitsofinfo')
asNode().appendNode('scm')
.appendNode('connection', "scm:git:https://github.com/bitsofinfo/hazelcast-consul-discovery-spi.git").parent()
.appendNode('developerConnection', "scm:git:https://github.com/bitsofinfo/hazelcast-consul-discovery-spi.git").parent()
.appendNode('url', "https://github.com/bitsofinfo/hazelcast-consul-discovery-spi")
}
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: 'javadoc') {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
task runTests(type: Test) {
description 'Runs unit tests for all tests except TestDoNothingRegistrator.'
//Always run tests even when up-to-date
outputs.upToDateWhen {
false
}
systemProperties = [
consulHost: System.getProperty('consulHost', 'localhost'),
consulPort: System.getProperty('consulPort', '8500'),
consulAclToken: System.getProperty('consulAclToken', ''),
consulSslEnabled: System.getProperty('consulSslEnabled', 'false'),
consulSslServerCertFilePath: System.getProperty('consulSslServerCertFilePath', ''),
consulSslServerCertBase64: System.getProperty('consulSslServerCertBase64', ''),
consulSslServerHostnameVerify: System.getProperty('consulSslServerHostnameVerify', 'true'),
consulHealthCheckProvider: System.getProperty('consulHealthCheckProvider', 'org.bitsofinfo.hazelcast.discovery.consul.ScriptHealthCheckBuilder')
]
//Exclude TestDoNothingRegistrator test because it requires special setup
exclude "**/TestDoNothingRegistrator.class"
}
task unitTest(type: Test) {
description 'Runs unit tests for single class.'
//Always run tests even when up-to-date
outputs.upToDateWhen {
false
}
systemProperties = [
consulHost: System.getProperty('consulHost', 'localhost'),
consulPort: System.getProperty('consulPort', '8500'),
consulAclToken: System.getProperty('consulAclToken', ''),
consulSslEnabled: System.getProperty('consulSslEnabled', 'false'),
consulSslServerCertFilePath: System.getProperty('consulSslServerCertFilePath', ''),
consulSslServerCertBase64: System.getProperty('consulSslServerCertBase64', ''),
consulSslServerHostnameVerify: System.getProperty('consulSslServerHostnameVerify', 'true'),
consulHealthCheckProvider: System.getProperty('consulHealthCheckProvider', 'org.bitsofinfo.hazelcast.discovery.consul.ScriptHealthCheckBuilder')
]
}
runTests {
testLogging {
// Show that tests are run in the command-line output
events 'started', 'passed'
}
}
unitTest {
testLogging {
// Show that tests are run in the command-line output
events 'started', 'passed'
}
}