forked from sgroschupf/zkclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
149 lines (130 loc) · 3.91 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'project-reports'
apply plugin: 'osgi'
group = 'com.101tec'
version = '0.4-dev'
sourceCompatibility = 1.6
jar {
manifest {
attributes 'Implementation-Title': 'ZkClient', 'Implementation-Version': version
}
}
//--------------------
// Dependencies
//--------------------
repositories {
flatDir(dirs: 'lib')
mavenCentral()
// maven {
// url "https://oss.sonatype.org/content/repositories/com101tec-553"
//}
}
dependencies {
//compile 'com.101tec:zkclient:0.2'
compile 'org.slf4j:log4j-over-slf4j:1.6.6'
// compile ('log4j:log4j:1.2.14') {
// exclude group: "com.sun.jdmk", module: "jmxtools"
// exclude group: "com.sun.jmx", module: "jmxri"
// exclude group: "javax.jms", module: "jms"
// }
compile ('org.apache.zookeeper:zookeeper:3.3.1') {
exclude group: "com.sun.jdmk", module: "jmxtools"
exclude group: "com.sun.jmx", module: "jmxri"
exclude group: "javax.jms", module: "jms"
exclude group: "log4j", module: "log4j"
}
testCompile 'junit:junit:4.7'
testCompile 'commons-io:commons-io:1.4'
testCompile 'org.mockito:mockito-core:1.8.0'
//dependencies of mockito
testCompile files('lib/objenesis-1.0.jar', 'lib/hamcrest-core-1.1.jar')
// a logger implementation for runtime
runtime 'ch.qos.logback:logback-classic:1.0.7'
}
//--------------------
// Source Jar
//--------------------
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
}
task jars(dependsOn: ['jar','sourceJar'], description: 'Build jar & source jar') << {}
//--------------------
// Eclipse Setup
//--------------------
eclipse {
classpath {
defaultOutputDir = file('build-eclipse')
}
}
task eclipseJdtPrepare(type: Copy) {
from rootProject.file('src/build/eclipse/org.eclipse.jdt.core.prefs')
into project.file('.settings/')
}
tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare)
//--------------------
// Maven Artifact publishing
//--------------------
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories.mavenDeployer {
//repository(url: "file:///tmp/mavenRepo")
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.project {
name 'ZkClient'
packaging 'jar'
description 'A zookeeper client, that makes life a little easier.'
url 'https://github.com/sgroschupf/zkclient'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/sgroschupf/zkclient'
connection 'scm:git:git://github.com/sgroschupf/zkclient.git'
developerConnection 'scm:git:https://github.com/sgroschupf/zkclient.git'
}
developers {
developer {
id 'sgroschupf'
name 'Stefan Groshupf'
}
developer {
id 'pvoss'
name 'Peter Voss'
}
developer {
id 'jzillmann'
name 'Johannes Zillmann'
}
}
}
}
}
//--------------------
// Util methods
//--------------------
task wrapper(type: Wrapper, description: 'Generate the Gradle Wrapper') {
gradleVersion = '1.3'
}