forked from puniverse/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
325 lines (302 loc) · 11.4 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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
apply plugin: 'java'
sourceCompatibility = '1.7'
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
group = "co.paralleluniverse"
version = "1.4.1-SNAPSHOT"
status = "integration"
description = "A high-performance in-memory data-grid."
ext.url = "http://puniverse.github.com/galaxy"
ext.vendor = "Parallel Universe Software Co."
ext.licenseName = "The GNU Lesser General Public License, version 3"
ext.licenseUrl = "http://www.gnu.org/licenses/lgpl-3.0.txt"
ext.scmUrl = "https://github.com/puniverse/galaxy"
ext.scmConnection = "https://github.com/puniverse/galaxy.git"
ext.distDir = "$buildDir/dist"
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
if (!project.hasProperty("sonatypeUsername") || !project.hasProperty("sonatypePassword")) {
println "sonatype username or password not set"
ext.sonatypeUsername = ""
ext.sonatypePassword = ""
}
configurations {
all*.exclude group: 'javax.jms', module: 'jms'
all*.exclude group: 'com.sun.jdmk', module: 'jmxtools'
all*.exclude group: 'com.sun.jmx', module: 'jmxri'
all*.exclude group: 'javax.mail', module: 'mail'
// published
javancssConf
}
repositories {
flatDir { dirs 'baselib' }
repositories {
mavenCentral()
}
}
configurations.all {
resolutionStrategy {
failOnVersionConflict()
}
}
dependencies {
compile "com.google.guava:guava:18.0"
compile 'it.unimi.dsi:fastutil:6.6.2' // compile "net.sf.trove4j:trove4j:3.0.3"
compile "org.springframework:spring-beans:4.0.6.RELEASE"
compile "org.springframework:spring-context:4.0.6.RELEASE"
compile ("com.codahale.metrics:metrics-core:3.0.2") {
exclude group: "org.slf4j", module: '*'
}
compile "io.netty:netty:3.10.4.Final"
compile "org.jgroups:jgroups:3.6.0.Final"
compile "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4"
compile "com.sleepycat:je:5.0.73"
compile "co.parallelunivese:high-scale-lib:" // non-Maven
compile "org.slf4j:slf4j-api:1.7.7"
runtime "org.slf4j:jcl-over-slf4j:1.7.7"
runtime "org.slf4j:log4j-over-slf4j:1.7.7"
runtime "org.apache.logging.log4j:log4j-slf4j-impl:2.0.2"
runtime "org.apache.logging.log4j:log4j-api:2.0.2"
runtime "org.apache.logging.log4j:log4j-core:2.0.2"
runtime "com.lmax:disruptor:3.3.0" // required for log4j
compile("org.apache.zookeeper:zookeeper:3.4.6") {
exclude group: "org.slf4j", module: '*'
exclude group: "com.google.guava", module: '*'
exclude group: "io.netty", module: 'netty'
exclude group: "junit", module: '*'
}
compile("org.apache.curator:curator-recipes:$APACHE_CURATOR_VERSION") {
exclude group: "org.slf4j", module: '*'
exclude group: "com.google.guava", module: '*'
exclude group: "org.apache.zookeeper", module: "zookeeper"
}
compile("org.apache.curator:curator-client:$APACHE_CURATOR_VERSION") {
exclude group: "org.slf4j", module: '*'
exclude group: "com.google.guava", module: '*'
exclude group: "org.apache.zookeeper", module: "zookeeper"
}
compile("org.apache.curator:curator-framework:$APACHE_CURATOR_VERSION") {
exclude group: "org.slf4j", module: '*'
exclude group: "com.google.guava", module: '*'
exclude group: "org.apache.zookeeper", module: "zookeeper"
}
compile("com.esotericsoftware.kryo:kryo:2.24.0") {
exclude group: "org.ow2.asm", module: '*'
}
compile("de.javakaffee:kryo-serializers:0.27") {
exclude group: "com.esotericsoftware.kryo", module: '*'
}
testCompile("org.apache.curator:curator-test:$APACHE_CURATOR_VERSION") {
exclude group: "org.slf4j", module: '*'
exclude group: "com.google.guava", module: '*'
exclude group: "org.apache.zookeeper", module: "zookeeper"
}
testCompile "junit:junit:4.11"
testCompile ('org.truth0:truth:0.23') {
exclude group: 'junit', module: '*'
exclude group: "com.google.guava", module: '*'
}
testCompile "org.hamcrest:hamcrest-core:1.3"
testCompile "org.hamcrest:hamcrest-library:1.3"
testCompile "org.mockito:mockito-all:1.9.5"
testCompile ('org.gridkit.lab:telecontrol-ssh:0.7.24'){
exclude group: "org.slf4j", module: '*'
exclude group: "org.ow2.asm", module: '*'
}
}
///////// Doduments
configure (javadoc) {
destinationDir = file("docs/javadoc")
options.links = [
"http://docs.oracle.com/javase/7/docs/api/",
"http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/"
]
excludes = [
"co/paralleluniverse/common/MonitoringType.java",
"co/paralleluniverse/common/DegenerateInvocationHandler.java",
"co/paralleluniverse/common/ConcurrentThreadExecutor.java",
"co/paralleluniverse/common/DOMElementPropertyEditor.java",
"co/paralleluniverse/common/collection/**",
"co/paralleluniverse/common/io/ByteBufferInputStream.java",
"co/paralleluniverse/common/io/ByteBufferOutputStream.java",
"co/paralleluniverse/common/io/Checksum.java",
"co/paralleluniverse/common/io/DataObjectInputAdapter.java",
"co/paralleluniverse/common/io/DataObjectOutputAdapter.java",
"co/paralleluniverse/common/io/DoubleHasher.java",
"co/paralleluniverse/common/io/Hasher.java",
"co/paralleluniverse/common/io/MessageDigestChecksum.java",
"co/paralleluniverse/common/spring/SpringContainerHelper.java",
"co/paralleluniverse/common/logging/**",
"co/paralleluniverse/common/monitoring/**",
"co/paralleluniverse/common/util/**",
"co/paralleluniverse/galaxy/core/**",
"co/paralleluniverse/galaxy/berkeleydb/**",
"co/paralleluniverse/galaxy/jdbc/**",
"co/paralleluniverse/galaxy/jgroups/**",
"co/paralleluniverse/galaxy/monitoring/**",
"co/paralleluniverse/galaxy/netty/**",
"co/paralleluniverse/galaxy/objects/**",
"co/paralleluniverse/galaxy/redis/**",
"co/paralleluniverse/galaxy/server/**",
"co/paralleluniverse/galaxy/zookeeper/**"
]
}
////////// Distribution
task copyDependenciesToDist(type:Copy) {
from configurations.runtime
into "$distDir/lib"
}
task srcZip(type:Zip) {
archiveName "src.zip"
from "src"
}
task copyConfigToDist(type:Copy) {
from 'config'
into "$distDir/config"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
[jar, sourcesJar, javadocJar, srcZip]*.destinationDir = file(distDir)
jar {
from zipTree('baselib/high-scale-lib.jar') // include non-Maven jars
manifest {
attributes(
"Built-By" : System.getProperty("user.name"),
"Implementation-Title" : name,
"Implementation-Version" : version,
"Implementation-Vendor" : vendor,
"Class-Path" : configurations.runtime.collect { "lib/"+it.getName() }.join(',')
)
}
}
task dist {
dependsOn copyDependenciesToDist,copyConfigToDist,jar,sourcesJar,javadocJar,srcZip,javadoc
}
defaultTasks 'distNoDocs'
task distZip(type:Zip, dependsOn: dist) {
archiveName project.name+"-"+project.version+".zip"
from distDir
}
assemble.dependsOn dist
///////// Site
apply plugin: 'github-pages'
//githubPages { repoUri = 'https://github.com/puniverse/galaxy.git' }
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.ajoberstar:gradle-git:0.9.0' }
}
///////// Publish Artifacts
apply plugin: 'maven'
apply plugin: 'signing'
artifacts {
archives jar
archives sourcesJar
archives javadocJar
// archives distZip
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
// remove high scale lib from local install pom
configure(install.repositories.mavenInstaller) {
pom.whenConfigured { pom -> pom.dependencies = pom.dependencies.findAll {
dep -> !dep.artifactId.startsWith('high-scale-lib') }
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(
url: (isReleaseVersion ?
"https://oss.sonatype.org/service/local/staging/deploy/maven2" :
"https://oss.sonatype.org/content/repositories/snapshots")) {
// User and Password are taken from ~/.gradle/gradle.properties
authentication(userName: project.sonatypeUsername, password: project.sonatypePassword)
}
pom.whenConfigured { pom -> pom.dependencies = pom.dependencies.findAll {
dep -> !dep.artifactId.startsWith('high-scale-lib') }
}
pom.project {
name project.name
packaging 'jar'
description project.description
url project.url
scm {
url project.scmUrl
connection project.scmConnection
developerConnection project.scmConnection
}
licenses {
license {
name project.licenseName
url project.licenseUrl
distribution 'repo'
}
}
developers {
developer {
id 'pron'
name 'Ron Pressler'
}
developer {
id 'eitan'
name 'Eitan Yarden'
}
}
}
}
}
}
//////// Javancss
dependencies {
javancssConf 'org.codehaus.javancss:javancss:33.54'
}
task javancss(dependsOn: 'classes') << {
ext.reportName = "$buildDir/javancss_metrics.txt"
println 'Running javancss quality metrics tool to file://'+reportName
ant {
logging.level = LogLevel.INFO
taskdef(name:'javancss', classname:'javancss.JavancssAntTask', classpath: configurations.javancssConf.asPath)
javancss(
srcdir:'src/main/java',
abortOnFail:'true',
generateReport:'true',
packageMetrics:'true',
classMetrics:'false',
functionMetrics:'false'
// outputFile: reportName,
)
}
}
/////// Others
tasks.withType(Test) {
systemProperty "log4j.configurationFile", "log4j.xml"
systemProperty "jgroups.bind_addr", "127.0.0.1"
systemProperty "Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"
useJUnit()
doLast() {
println "file://" + getReports().getHtml().getDestination() + "/index.html"
}
}
test {
beforeTest { desc ->
logger.quiet("Running test: " + desc)
}
afterTest { desc, result ->
if(result.resultType == TestResult.ResultType.FAILURE) {
logger.quiet("Failed test ${desc.name} [${desc.className}] with exception: ${result.exception}")
if(result.exception != null) {
result.exception.printStackTrace()
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}