This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
/
build.gradle
296 lines (248 loc) · 9.22 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
// used for artifact names, building doc upload urls, etc.
description = 'Spring Hadoop'
abbreviation = 'DATAHADOOP'
apply plugin: 'base'
buildscript {
repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = "GitHub"
addIvyPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[artifact]-[revision].[ext]'
addArtifactPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[revision].[ext]'
}
mavenCentral()
mavenLocal()
mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release"
mavenRepo name: "springsource-org-external", urls: "http://repository.springsource.com/maven/bundles/external"
}
dependencies {
classpath 'org.springframework:gradle-stuff:0.1-20110421'
classpath 'net.sf.docbook:docbook-xsl:1.75.2:ns-resources@zip'
}
}
allprojects {
group = 'org.springframework.data.hadoop'
version = "$springHadoopVersion"
releaseBuild = version.endsWith('RELEASE')
snapshotBuild = version.endsWith('SNAPSHOT')
repositories {
mavenLocal()
mavenCentral()
// Public Spring artefacts
mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release"
mavenRepo name: "spring-release", urls: "http://maven.springframework.org/release"
mavenRepo name: "spring-milestone", urls: "http://maven.springframework.org/milestone"
mavenRepo name: "spring-snapshot", urls: "http://maven.springframework.org/snapshot"
mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots"
mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/"
}
}
apply plugin: "java"
apply plugin: "maven"
apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project
apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml
apply plugin: 'docbook'
apply plugin: 'bundlor' // all core projects should be OSGi-compliant
bundlor.useProjectProps = true
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"]
skipPig = true
skipHive = true
skipHBase = true
task enablePigTests {
description = "Enable Pig tests"
group = "Verification"
doLast() {
project.skipPig = false
}
}
task enableHiveTests {
description = "Enable Hive tests"
group = "Verification"
doLast() {
project.skipHive = false
}
}
task enableHBaseTests {
description = "Enable HBase tests"
group = "Verification"
doLast() {
project.skipHBase = false
}
}
task enableAllTests() {
description = "Enable all (incl. Pig, Hive, HBase) tests"
group = "Verification"
doFirst() {
println "Enable all tests"
project.skipPig = false
project.skipHBase = false
project.skipHive = false
}
}
test {
//forkEvery = 1
systemProperties['input.path'] = 'build/classes/test/input'
systemProperties['output.path'] = 'build/classes/test/output'
includes = ["**/*.class"]
doFirst() {
msg = ""
if (skipPig)
{
msg += "Pig "
excludes.add("**/pig/**")
}
if (skipHBase)
{
msg += "HBase "
excludes.add("**/hbase/**")
}
if (skipHive)
{
msg += "Hive"
excludes.add("**/hive/**")
}
if (!msg.isEmpty())
println "Skipping [$msg] Tests";
}
}
// Common dependencies
dependencies {
// Logging
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
runtime "log4j:log4j:$log4jVersion"
runtime "org.slf4j:slf4j-log4j12:$slf4jVersion"
// Spring Framework
compile("org.springframework:spring-core:$springVersion") {
exclude module: "commons-logging"
}
compile "org.springframework:spring-context-support:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-oxm:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
compile "org.springframework.integration:spring-integration-core:$springIntVersion"
// Hadoop
compile "org.apache.hadoop:hadoop-core:$hadoopVersion"
compile "org.apache.hadoop:hadoop-streaming:$hadoopVersion"
compile "commons-io:commons-io:$commonsioVersion"
compile "org.codehaus.jackson:jackson-core-asl:$jacksonVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "cglib:cglib:$cglibVersion"
// Hive
compile "org.apache.hive:hive-common:$hiveVersion"
compile "org.apache.hive:hive-jdbc:$hiveVersion"
compile "org.apache.hive:hive-service:$hiveVersion"
compile "org.apache.hive:hive-metastore:$hiveVersion"
compile "org.apache.hive:hive-shims:$hiveVersion"
compile "org.apache.hive:hive-serde:$hiveVersion"
compile "org.apache.thrift:libthrift:$thriftVersion"
compile "org.apache.thrift:libfb303:$thriftVersion"
// Pig
compile "org.apache.pig:pig:$pigVersion"
compile "org.antlr:antlr-runtime:$antlrVersion"
// HBase
compile "org.apache.hbase:hbase:$hbaseVersion"
// Testing
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile("javax.annotation:jsr250-api:1.0") { optional = true }
testCompile "org.apache.hadoop:hadoop-examples:$hadoopVersion"
testCompile "org.springframework.integration:spring-integration-event:$springIntVersion"
testCompile "org.springframework.integration:spring-integration-file:$springIntVersion"
}
javaprojects = rootProject
sourceCompatibility = 1.6
targetCompatibility = 1.6
javadoc {
srcDir = file("${projectDir}/docs/src/api")
destinationDir = file("${buildDir}/api")
tmpDir = file("${buildDir}/api-work")
configure(options) {
stylesheetFile = file("${srcDir}/spring-javadoc.css")
overview = "${srcDir}/overview.html"
docFilesSubDirs = true
outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
breakIterator = true
showFromProtected()
groups = [
'Spring Data Hadoop' : ['org.springframework.data.hadoop*'],
]
links = [
"http://static.springframework.org/spring/docs/3.1.x/javadoc-api",
"http://download.oracle.com/javase/6/docs/api",
"http://logging.apache.org/log4j/docs/api/",
"http://atinject.googlecode.com/svn/trunk/javadoc/",
"http://jakarta.apache.org/commons/logging/apidocs/"
]
exclude "org/springframework/data/hadoop/config/**"
}
title = "${rootProject.description} ${version} API"
// collect all the sources that will be included in the javadoc output
source javaprojects.collect {project ->
project.sourceSets.main.allJava
}
// collect all main classpaths to be able to resolve @see refs, etc.
// this collection also determines the set of projects that this
// task dependsOn, thus the runtimeClasspath is used to ensure all
// projects are included, not just *dependencies* of all classes.
// this is awkward and took me a while to figure out.
classpath = files(javaprojects.collect {project ->
project.sourceSets.main.runtimeClasspath
})
// copy the images from the doc-files dir over to the target
doLast { task ->
copy {
from file("${task.srcDir}/doc-files")
into file("${task.destinationDir}/doc-files")
}
}
}
ideaProject {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-3'
description = "Generate the Gradle wrapper"
group = "Distribution"
}
apply from: "$rootDir/maven.gradle"
// Distribution tasks
task dist(type: Zip) {
description = "Generate the ZIP Distribution"
group = "Distribution"
dependsOn assemble, subprojects*.tasks*.matching { task -> task.name == 'assemble' }
evaluationDependsOn(':docs')
def zipRootDir = "${project.name}-$version"
into(zipRootDir) {
from('/docs/src/info') {
include '*.txt'
}
from('/docs/build/') {
into 'docs'
include 'reference/**/*'
}
from('build/') {
into 'docs'
include 'api/**/*'
}
into('dist') {
from javaprojects.collect {project -> project.libsDir }
}
}
doLast {
ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1')
}
}
task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload, dependsOn: dist) {
description = "Upload the ZIP Distribution"
group = "Distribution"
archiveFile = dist.archivePath
projectKey = 'SHDP'
projectName = 'Spring Data Hadoop'
}
assemble.dependsOn = ['jar', 'sourceJar', 'javadocJar']
defaultTasks 'clean', 'build'