This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
286 lines (235 loc) · 8.35 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
description = 'Impala'
allprojects {
group = "org.springframework.data.hadoop.impala"
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
apply from: "${rootProject.projectDir}/maven.gradle"
repositories {
maven { url "http://repo.springsource.org/libs-snapshot" }
maven { url "http://spring-roo-repository.springsource.org/release" }
}
dependencies {
compile ("org.apache.hadoop:hadoop-core:$hadoopVersion", optional)
compile ("org.springframework.data:spring-data-hadoop:$shdpVersion") {
exclude module: "hbase"
}
compile "org.springframework.shell:spring-shell:$springShellVersion"
testCompile "junit:junit:$junitVersion"
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
configure(subprojects) { subproject ->
jar {
manifest.attributes['Implementation-Title'] = rootProject.name + " " + subproject.name
manifest.attributes['Implementation-Version'] = subproject.version
from("${rootProject.projectDir}/docs/info") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format('yyyy'), version: project.version)
}
}
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.overview = "${rootProject.projectDir}/docs/api/overview.html"
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
project('plugin-common') {
description = 'Impala Common plugin'
}
project('plugin-hdfs') {
description = 'Impala HDFS plugin'
dependencies {
compile project(':plugin-common')
compile "javax.ws.rs:jsr311-api:$jsr311Version"
}
}
project('plugin-mapreduce') {
description = 'Impala MapReduce plugin'
dependencies {
compile project(':plugin-common')
}
}
project('plugin-hive') {
description = 'Impala Hive plugin'
dependencies {
compile project(':plugin-common')
compile("org.apache.hive:hive-service:$hiveVersion") {
exclude module: "antlr"
exclude module: "org.antlr"
exclude module: "antlr-runtime"
exclude module: "jline"
}
}
}
project('plugin-pig') {
description = 'Impala Pig plugin'
dependencies {
compile project(':plugin-common')
compile("org.apache.pig:pig:$pigVersion")
compile "org.antlr:antlr-runtime:3.4"
}
}
project('plugin-r') {
description = 'Impala R plugin'
}
configure(rootProject) {
description = 'Impala'
// apply plugin: 'docbook-reference'
// reference {
// sourceDir = file('docs/reference/docbook')
// }
// don't publish the default jar for the root project
configurations.archives.artifacts.clear()
task api(type: Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
title = "${rootProject.description} ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = 'docs/api/overview.html'
options.splitIndex = true
options.links(
"http://download.oracle.com/javase/6/docs/api",
"http://static.springframework.org/spring/docs/3.1.x/javadoc-api",
"http://static.springframework.org/spring-hadoop/docs/current/api",
"http://static.springsource.org/spring-batch/apidocs/",
"http://hadoop.apache.org/common/docs/current/api/"
)
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
maxMemory = '1024m'
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/impala/docs."
from('docs/info') {
include 'changelog.txt'
}
from (api) {
into 'api'
}
// from (reference) {
// into 'reference'
// }
}
task distroZip(type: Zip, dependsOn: [docsZip]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('docs/info') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
expand(copyright: new Date().format('yyyy'), version: project.version)
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
subprojects.each { subproject ->
into ("${baseDir}/dist") {
from subproject.jar
if (subproject.tasks.findByPath('sourcesJar')) {
from subproject.sourcesJar
}
if (subproject.tasks.findByPath('javadocJar')) {
from subproject.javadocJar
}
}
}
}
// Create an distribution that contains all dependencies (required and optional).
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distroZip) { zipTask ->
group = 'Distribution'
classifier = 'dist-with-deps'
description = "Builds -${classifier} archive, containing everything " +
"in the -${distroZip.classifier} archive plus all runtime dependencies."
from zipTree(distroZip.archivePath)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectNames = rootProject.subprojects*.name
def artifacts = new HashSet()
subprojects.each { subproject ->
subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distroZip.baseDir}/deps"
}
}
}
}
apply plugin: 'application'
mainClassName = "org.springframework.shell.Bootstrap"
startScripts {
classpath = files("foobarbaz")
doLast {
def text = unixScript.getText("utf-8")
def changed = text.replaceAll("foobarbaz", java.util.regex.Matcher.quoteReplacement(':$APP_HOME/lib/*'))
unixScript.write(changed)
def winText = windowsScript.getText("utf-8")
def changedWin = winText.replaceAll("foobarbaz", java.util.regex.Matcher.quoteReplacement(';%APP_HOME%\\lib\\*'))
windowsScript.write(changedWin)
}
}
configurations { dist }
dependencies {
dist subprojects
}
applicationDistribution.with {
into("lib") {
from file('plugin-common/src/main/resources/log4j.properties')
from configurations.dist
}
}
task runtimeZip(type: Zip, dependsOn: [installApp]) {
group = 'Distribution'
classifier = 'runtime'
description = "Builds -${classifier} archive, bundling the project as a JVM application with libs and OS specific scripts."
ext.baseDir = "${project.name}-${project.version}";
from("${project.buildDir}/install/") {
}
}
artifacts {
archives docsZip
archives distroZip
archives runtimeZip
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.0'
}
}
defaultTasks 'build'