-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
134 lines (112 loc) · 4.13 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
buildscript {
repositories {
jcenter()
}
}
plugins {
id "com.jfrog.bintray" version "1.5"
}
group = 'cc.springcloud'
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:'3.+'
compile group: 'com.ecwid.consul', name: 'consul-api', version:'1.3.1'
compile group: 'commons-codec', name: 'commons-codec', version:'1.8'
// for consul-client
testCompile 'org.apache.cxf:cxf-rt-rs-client:3.0.3'
testCompile 'org.apache.cxf:cxf-rt-transports-http-hc:3.0.3'
testCompile 'junit:junit:4.12'
}
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/XYUU/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
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
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', 'cc.springcloud.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', 'cc.springcloud.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'
}
}
artifacts {
archives sourcesJar
}