Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 355 lines (288 sloc) 10.429 kb
ebc156d + initial migration to Gradle
Costin Leau authored
1 buildscript {
2 repositories {
480b371 use released version of docbook plugin + schema fix
Costin Leau authored
3 maven { url 'http://repo.springsource.org/plugins-release' }
ebc156d + initial migration to Gradle
Costin Leau authored
4 }
5 dependencies {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
6 classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5'
ebc156d + initial migration to Gradle
Costin Leau authored
7 }
8 }
9
ae8fe74 make webhdfs tests optional
Costin Leau authored
10 description = 'Spring for Apache Hadoop'
363b16f fix groupId
Costin Leau authored
11 group = 'org.springframework.data'
239fd1d align gradle build to spring framework
Costin Leau authored
12
13 repositories {
14 maven { url "http://repo.springsource.org/libs-snapshot" }
15 }
16
17 apply plugin: "java"
18 apply plugin: 'eclipse'
19 apply plugin: 'idea'
20 apply from: "$rootDir/maven.gradle"
21 apply plugin: 'docbook-reference'
22
23
24 // Common dependencies
25 dependencies {
26 // Hadoop
27 compile("org.apache.hadoop:hadoop-core:$hadoopVersion", optional)
28 compile("org.apache.hadoop:hadoop-streaming:$hadoopVersion", optional)
29 compile("org.apache.hadoop:hadoop-tools:$hadoopVersion", optional)
30
31 // Logging
32 compile "org.slf4j:slf4j-api:$slf4jVersion"
33 compile ("org.slf4j:jcl-over-slf4j:$slf4jVersion", optional)
eedf70f make log4j optional
Costin Leau authored
34 testRuntime "log4j:log4j:$log4jVersion"
35 testRuntime "org.slf4j:slf4j-log4j12:$slf4jVersion"
36
239fd1d align gradle build to spring framework
Costin Leau authored
37 // Spring Framework
38 compile("org.springframework:spring-core:$springVersion") {
39 exclude module: "commons-logging"
40 }
41 compile "org.springframework:spring-context-support:$springVersion"
42 compile("org.springframework:spring-tx:$springVersion", optional)
43 compile("org.springframework:spring-aop:$springVersion", optional)
44 compile("org.springframework:spring-jdbc:$springVersion", optional)
45 compile("org.springframework.batch:spring-batch-core:$springBatchVersion", optional)
a565cdd update SI dependencies
Costin Leau authored
46 compile("org.springframework.integration:spring-integration-stream:$springIntVersion", optional)
ceb237b make spring-integration-file a compile dependency
Costin Leau authored
47 compile("org.springframework.integration:spring-integration-file:$springIntVersion", optional)
a565cdd update SI dependencies
Costin Leau authored
48
239fd1d align gradle build to spring framework
Costin Leau authored
49
50 // cascading
51 compile("cascading:cascading-hadoop:$cascadingVersion", optional)
52
c6a38a5 upgrade to Hadoop 1.0.3
Costin Leau authored
53 // Missing dependency in Hadoop 1.0.3
54 testRuntime "commons-io:commons-io:$commonsioVersion"
239fd1d align gradle build to spring framework
Costin Leau authored
55 //testRuntime "org.codehaus.jackson:jackson-core-asl:$jacksonVersion"
56 testRuntime "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
57 testRuntime "cglib:cglib:$cglibVersion"
ebc156d + initial migration to Gradle
Costin Leau authored
58
239fd1d align gradle build to spring framework
Costin Leau authored
59 // Hive
6702924 mark hive-metastore as optional
Costin Leau authored
60 compile("org.apache.hive:hive-metastore:$hiveVersion", optional)
239fd1d align gradle build to spring framework
Costin Leau authored
61 compile("org.apache.hive:hive-service:$hiveVersion", optional)
ebc156d + initial migration to Gradle
Costin Leau authored
62
6702924 mark hive-metastore as optional
Costin Leau authored
63 testRuntime "org.apache.hive:hive-common:$hiveVersion"
64 testRuntime "org.apache.hive:hive-jdbc:$hiveVersion"
239fd1d align gradle build to spring framework
Costin Leau authored
65 testRuntime "org.apache.hive:hive-shims:$hiveVersion"
66 testRuntime "org.apache.hive:hive-serde:$hiveVersion"
67 testRuntime "org.apache.thrift:libthrift:$thriftVersion"
68 testRuntime "org.apache.thrift:libfb303:$thriftVersion"
69
70 // Pig
71 compile("org.apache.pig:pig:$pigVersion", optional)
72
73 // HBase
52089c9 make HBase dependency optional
Costin Leau authored
74 compile("org.apache.hbase:hbase:$hbaseVersion") { dep ->
75 optional dep
239fd1d align gradle build to spring framework
Costin Leau authored
76 exclude module: "thrift"
77 }
78
79 // Libs dependencies (specified to cope with incompatibilities between them)
b09ba59 remove jdo2-api dependency
Costin Leau authored
80 // testRuntime "org.antlr:antlr:$antlrVersion"
81 // testRuntime "org.antlr:antlr-runtime:$antlrVersion"
239fd1d align gradle build to spring framework
Costin Leau authored
82
83
84 // Testing
85 testCompile "junit:junit:$junitVersion"
86 testCompile "org.mockito:mockito-core:$mockitoVersion"
87 testCompile "org.springframework:spring-test:$springVersion"
88 testCompile("javax.annotation:jsr250-api:1.0", optional)
89 testCompile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
a565cdd update SI dependencies
Costin Leau authored
90
239fd1d align gradle build to spring framework
Costin Leau authored
91 testRuntime "org.springframework.integration:spring-integration-event:$springIntVersion"
a565cdd update SI dependencies
Costin Leau authored
92
239fd1d align gradle build to spring framework
Costin Leau authored
93 testRuntime "org.codehaus.groovy:groovy:$groovyVersion"
94 testRuntime "org.jruby:jruby:$jrubyVersion"
95 testRuntime "org.python:jython-standalone:$jythonVersion"
96 testRuntime "org.apache.hive:hive-builtins:$hiveVersion"
b09ba59 remove jdo2-api dependency
Costin Leau authored
97
239fd1d align gradle build to spring framework
Costin Leau authored
98 // specify a version of antlr that works with both hive and pig
99 testRuntime "org.antlr:antlr-runtime:$antlrVersion"
100 testCompile "cascading:cascading-local:$cascadingVersion"
a565cdd update SI dependencies
Costin Leau authored
101
239fd1d align gradle build to spring framework
Costin Leau authored
102 }
ebc156d + initial migration to Gradle
Costin Leau authored
103
239fd1d align gradle build to spring framework
Costin Leau authored
104 sourceCompatibility = 1.6
105 targetCompatibility = 1.6
106
ebc156d + initial migration to Gradle
Costin Leau authored
107
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
108 ext.skipPig = true
109 ext.skipHive = true
110 ext.skipHBase = true
111 ext.skipWebHdfs = true
6e697ae + add hbase namespace
Costin Leau authored
112
113 task enablePigTests {
114 description = "Enable Pig tests"
115 group = "Verification"
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
116
117 doLast() {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
118 project.ext.skipPig = false
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
119 }
6e697ae + add hbase namespace
Costin Leau authored
120 }
121
122 task enableHiveTests {
123 description = "Enable Hive tests"
124 group = "Verification"
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
125 doLast() {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
126 project.ext.skipHive = false
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
127 }
6e697ae + add hbase namespace
Costin Leau authored
128 }
129
130 task enableHBaseTests {
131 description = "Enable HBase tests"
132 group = "Verification"
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
133 doLast() {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
134 project.ext.skipHBase = false
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
135 }
6e697ae + add hbase namespace
Costin Leau authored
136 }
137
ae8fe74 make webhdfs tests optional
Costin Leau authored
138 task enableWebHdfsTests {
139 description = "Enable WebHdfs tests"
140 group = "Verification"
141 doLast() {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
142 project.ext.skipWebHdfs = false
ae8fe74 make webhdfs tests optional
Costin Leau authored
143 }
144 }
145
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
146 task enableAllTests() {
ae8fe74 make webhdfs tests optional
Costin Leau authored
147 description = "Enable all (incl. Pig, Hive, HBase, WebHdfs) tests"
6e697ae + add hbase namespace
Costin Leau authored
148 group = "Verification"
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
149 doFirst() {
150 println "Enable all tests"
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
151 project.ext.skipPig = false
152 project.ext.skipHBase = false
153 project.ext.skipHive = false
154 project.ext.skipWebHdfs = false
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
155 }
6e697ae + add hbase namespace
Costin Leau authored
156 }
157
2eda8a4 + several fixes to make the integration tests work both in Eclipse an…
Costin Leau authored
158 test {
159 //forkEvery = 1
160 systemProperties['input.path'] = 'build/classes/test/input'
161 systemProperties['output.path'] = 'build/classes/test/output'
6e697ae + add hbase namespace
Costin Leau authored
162 includes = ["**/*.class"]
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
163
164 doFirst() {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
165 ext.msg = ""
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
166
ae8fe74 make webhdfs tests optional
Costin Leau authored
167 if (skipPig) {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
168 ext.msg += "Pig "
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
169 excludes.add("**/pig/**")
170 }
ae8fe74 make webhdfs tests optional
Costin Leau authored
171 if (skipHBase) {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
172 ext.msg += "HBase "
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
173 excludes.add("**/hbase/**")
174 }
175
ae8fe74 make webhdfs tests optional
Costin Leau authored
176 if (skipHive) {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
177 ext.msg += "Hive "
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
178 excludes.add("**/hive/**")
179 }
ae8fe74 make webhdfs tests optional
Costin Leau authored
180
181 if (skipWebHdfs) {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
182 ext.msg += "WebHdfs"
ae8fe74 make webhdfs tests optional
Costin Leau authored
183 excludes.add("**/WebHdfs*")
184 }
6e697ae + add hbase namespace
Costin Leau authored
185
fd151b7 + add task to enable individual integration tests (Pig/Hive/HBase)
Costin Leau authored
186 if (!msg.isEmpty())
187 println "Skipping [$msg] Tests";
6e697ae + add hbase namespace
Costin Leau authored
188 }
2eda8a4 + several fixes to make the integration tests work both in Eclipse an…
Costin Leau authored
189 }
ebc156d + initial migration to Gradle
Costin Leau authored
190
191 javadoc {
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
192 ext.srcDir = file("${projectDir}/docs/src/api")
ebc156d + initial migration to Gradle
Costin Leau authored
193
194 configure(options) {
195 stylesheetFile = file("${srcDir}/spring-javadoc.css")
196 overview = "${srcDir}/overview.html"
197 docFilesSubDirs = true
198 outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
199 breakIterator = true
58c95ee update javadoc links
Costin Leau authored
200 author = true
ebc156d + initial migration to Gradle
Costin Leau authored
201 showFromProtected()
73b52e4 + add package javadocs
Costin Leau authored
202
203 // groups = [
204 // 'Spring Data Hadoop' : ['org.springframework.data.hadoop*'],
205 // ]
ebc156d + initial migration to Gradle
Costin Leau authored
206
207 links = [
f949f20 update changelog and docs
Costin Leau authored
208 "http://static.springframework.org/spring/docs/3.0.x/javadoc-api",
ebc156d + initial migration to Gradle
Costin Leau authored
209 "http://download.oracle.com/javase/6/docs/api",
710ec2e fix cascading + log4j javadoc locations
Costin Leau authored
210 "http://logging.apache.org/log4j/1.2/apidocs/",
73b52e4 + add package javadocs
Costin Leau authored
211 "http://hadoop.apache.org/common/docs/current/api/",
212 "http://hbase.apache.org/apidocs/",
58c95ee update javadoc links
Costin Leau authored
213 "http://pig.apache.org/docs/r0.9.2/api/",
214 "http://hive.apache.org/docs/r0.8.1/api/",
73b52e4 + add package javadocs
Costin Leau authored
215 "http://static.springsource.org/spring-batch/apidocs/",
216 "http://static.springsource.org/spring-integration/api/",
c096ef3 javadoc improvements
Costin Leau authored
217 "https://builds.apache.org/job/Thrift/javadoc/",
2ea0e65 cascading update to latest wip
Costin Leau authored
218 "http://jakarta.apache.org/commons/logging/apidocs/",
710ec2e fix cascading + log4j javadoc locations
Costin Leau authored
219 "http://docs.cascading.org/cascading/2.0/javadoc/"
ebc156d + initial migration to Gradle
Costin Leau authored
220 ]
221
9cb5f27 + changed package from org.springframework.hadoop to org.sf.data.hadoop
Costin Leau authored
222 exclude "org/springframework/data/hadoop/config/**"
ebc156d + initial migration to Gradle
Costin Leau authored
223 }
224
225 title = "${rootProject.description} ${version} API"
239fd1d align gradle build to spring framework
Costin Leau authored
226 }
227
228 jar {
229 manifest.attributes['Implementation-Title'] = 'spring-data-hadoop'
230 manifest.attributes['Implementation-Version'] = project.version
0dcc79e and yet another try
Costin Leau authored
231 manifest.attributes['Build'] = "" + System.env['SHDP.BUILD']
232 manifest.attributes['Repository-Revision'] = "" + System.env['SHDP.REV']
239fd1d align gradle build to spring framework
Costin Leau authored
233
234 from("$rootDir/docs/src/info") {
235 include "license.txt"
236 include "notice.txt"
237 into "META-INF"
238 expand(copyright: new Date().format('yyyy'), version: project.version)
239 }
ebc156d + initial migration to Gradle
Costin Leau authored
240 }
241
239fd1d align gradle build to spring framework
Costin Leau authored
242 task sourcesJar(type: Jar, dependsOn:classes) {
243 classifier = 'sources'
244 from sourceSets.main.allJava
ebc156d + initial migration to Gradle
Costin Leau authored
245 }
246
239fd1d align gradle build to spring framework
Costin Leau authored
247 task javadocJar(type: Jar) {
248 classifier = 'javadoc'
249 from javadoc
ebc156d + initial migration to Gradle
Costin Leau authored
250 }
251
239fd1d align gradle build to spring framework
Costin Leau authored
252 reference {
253 sourceDir = file('docs/src/reference/docbook')
254 }
255
256
257 task docsZip(type: Zip) {
258 group = 'Distribution'
259 classifier = 'docs'
260 description = "Builds -${classifier} archive containing api and reference for deployment"
261
262 from('docs/src/info') {
263 include 'changelog.txt'
264 }
265
266 from (javadoc) {
267 into 'api'
268 }
269
270 from (reference) {
271 into 'reference'
272 }
273 }
274
275 task schemaZip(type: Zip) {
276 group = 'Distribution'
277 classifier = 'schema'
278 description = "Builds -${classifier} archive containing all XSDs for deployment"
ebc156d + initial migration to Gradle
Costin Leau authored
279
239fd1d align gradle build to spring framework
Costin Leau authored
280 def Properties schemas = new Properties();
281
282 sourceSets.main.resources.find {
480b371 use released version of docbook plugin + schema fix
Costin Leau authored
283 it.path.endsWith('META-INF' + File.separator + 'spring.schemas')
239fd1d align gradle build to spring framework
Costin Leau authored
284 }?.withInputStream { schemas.load(it) }
285
286 for (def key : schemas.keySet()) {
287 def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
21fc1bb update schema
Costin Leau authored
288 def alias = key.replaceAll(/http.*schema.(.*).(spring-.*)/, '$2')
239fd1d align gradle build to spring framework
Costin Leau authored
289 assert shortName != key
290 File xsdFile = sourceSets.main.resources.find {
480b371 use released version of docbook plugin + schema fix
Costin Leau authored
291 it.path.replace('\\', '/').endsWith(schemas.get(key))
ebc156d + initial migration to Gradle
Costin Leau authored
292 }
239fd1d align gradle build to spring framework
Costin Leau authored
293 assert xsdFile != null
21fc1bb update schema
Costin Leau authored
294
295 into (shortName) {
296 from xsdFile.path
297 rename { String fileName -> alias }
239fd1d align gradle build to spring framework
Costin Leau authored
298 }
21fc1bb update schema
Costin Leau authored
299 }
239fd1d align gradle build to spring framework
Costin Leau authored
300 }
301
302 task distZip(type: Zip, dependsOn: [jar, docsZip, schemaZip, sourcesJar, javadocJar]) {
303 group = 'Distribution'
304 classifier = 'dist'
305 description = "Builds -${classifier} archive, containing all jars and docs, " +
306 "suitable for community download page."
307
ccc4098 upgrade to gradle 1.0-rc3 and SI 2.1.2
Costin Leau authored
308 ext.zipRootDir = "${project.name}-${project.version}"
239fd1d align gradle build to spring framework
Costin Leau authored
309
310 into (zipRootDir) {
311 from('docs/src/info') {
312 include 'readme.txt'
313 include 'license.txt'
314 include 'notice.txt'
315 expand(copyright: new Date().format('yyyy'), version: project.version)
ebc156d + initial migration to Gradle
Costin Leau authored
316 }
239fd1d align gradle build to spring framework
Costin Leau authored
317
f949f20 update changelog and docs
Costin Leau authored
318 from('samples/') {
239fd1d align gradle build to spring framework
Costin Leau authored
319 into 'samples'
320 exclude '**/build/**'
321 exclude '**/bin/**'
322 exclude '**/.settings/**'
323 exclude '**/.gradle/**'
324 exclude '**/.*'
325 }
326
327 from(zipTree(docsZip.archivePath)) {
328 into "docs"
f949f20 update changelog and docs
Costin Leau authored
329 }
239fd1d align gradle build to spring framework
Costin Leau authored
330
331 from(zipTree(schemaZip.archivePath)) {
332 into "schema"
ebc156d + initial migration to Gradle
Costin Leau authored
333 }
239fd1d align gradle build to spring framework
Costin Leau authored
334 into ("dist") {
335 from rootProject.collect { project -> project.libsDir }
ebc156d + initial migration to Gradle
Costin Leau authored
336 }
337 }
338 }
339
239fd1d align gradle build to spring framework
Costin Leau authored
340 artifacts {
341 archives sourcesJar
342 archives javadocJar
343
344 archives docsZip
345 archives schemaZip
346 archives distZip
347 }
348
349 task wrapper(type: Wrapper) {
350 description = 'Generates gradlew[.bat] scripts'
fcef6be properly upgrade to Gradle 1.2
Costin Leau authored
351 gradleVersion = '1.2'
ebc156d + initial migration to Gradle
Costin Leau authored
352 }
353
239fd1d align gradle build to spring framework
Costin Leau authored
354 assemble.dependsOn = ['jar', 'sourcesJar']
2ea0e65 cascading update to latest wip
Costin Leau authored
355 defaultTasks 'build'
Something went wrong with that request. Please try again.