-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
65 lines (56 loc) · 1.7 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
plugins {
id "de.undercouch.download" version "3.1.1"
}
ext {
zeppelinProjectDir = "$buildDir/zeppelin"
zeppelinSourcesUrl = 'https://github.com/apache/zeppelin/archive/v0.6.0.zip'
mvnVersion = '3.3.9'
mvnHomeDir = "$buildDir/maven"
}
configurations {
maven
}
repositories {
mavenCentral()
}
dependencies {
maven "org.apache.maven:apache-maven:${mvnVersion}:bin@zip"
}
task extractMavenPackage(type: Copy){
destinationDir file(mvnHomeDir)
from zipTree(configurations.maven.singleFile)
includeEmptyDirs = false
eachFile { // workaround to skip first-level folder
List segments = it.relativePath.segments as List
it.path = segments.tail().join('/')
}
}
task downloadZeppelinSources(type: de.undercouch.gradle.tasks.download.Download) {
src zeppelinSourcesUrl
dest new File(buildDir, 'zeppelin.zip')
overwrite false
}
task extractZeppelinSources(type: Copy){
dependsOn downloadZeppelinSources
destinationDir file(zeppelinProjectDir)
from zipTree(downloadZeppelinSources.dest)
includeEmptyDirs = false
eachFile { // workaround to skip first-level folder
List segments = it.relativePath.segments as List
it.path = segments.tail().join('/')
}
}
task mvnCleanPackage(type: Exec) {
dependsOn extractMavenPackage, extractZeppelinSources
commandLine "${mvnHomeDir}/bin/mvn.cmd"
workingDir zeppelinProjectDir
args "-T", "2"
// args "-s", "$projectDir/settings.xml" // uncomment it if you want to provide custom settings.xml
args "clean", "package"
args "-DskipTests"
args "-P", "build-distr"
args "-Phadoop-2.6", "-Dhadoop.version=2.6.0", "-Dhbase.hbase.version=1.2.0", "-Dhbase.hadoop.version=2.6.0"
doFirst {
logger.lifecycle commandLine.join(' ')
}
}