-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
177 lines (141 loc) · 4.9 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.6.2.201302030002"
reportsDir = file("$buildDir/JacocoReportDir")
}
archivesBaseName = 'demandspike'
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
eclipse {
project {
name = 'DemandSpike'
}
classpath {
downloadSources=true
}
}
eclipse.classpath.defaultOutputDir = file( 'build/classes' )
group = 'com.neverwinterdp'
sourceCompatibility = 1.7
version = '1.0-SNAPSHOT'
configurations.compile.transitive = true
repositories {
mavenLocal()
mavenCentral()
maven {
url "http://clojars.org/repo"
}
}
configurations.all {
exclude(group: 'ring', name: 'ring-core', version: '0.3.11')
}
dependencies {
compile group: 'com.neverwinterdp', name: 'commons.utils', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.api', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.cluster', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.cluster', version: '1.0-SNAPSHOT', classifier: 'js'
compile group: 'com.neverwinterdp', name: 'commons.hadoop-framework', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.zookeeper', version: '1.0-SNAPSHOT'
testCompile group: 'com.neverwinterdp', name: 'commons.hadoop-framework', version: '1.0-SNAPSHOT', classifier: 'tests'
compile group: 'com.neverwinterdp', name: 'queuengin', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'sparkngin', version: '1.0-SNAPSHOT'
compile group: 'com.yammer.metrics', name: 'metrics-core', version: '2,2.0'
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: '2.4.0'
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: '2.4.0'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5'
compile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: '2.4.0'
compile group: 'org.apache.mrunit', name: 'mrunit', version: '1.0.0', classifier: 'hadoop2'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
test {
forkEvery = 1
ignoreFailures = true
testLogging.showStandardStreams = true
filter {
includeTestsMatching "*UnitTest"
}
}
task release (dependsOn: 'build') << {
def releaseDir = "${buildDir}/release/DemandSpike"
doRelease(releaseDir) ;
}
def doRelease(String releaseDir) {
println "\n\n"
println "*************************************************"
println "Preparing the release directory ${releaseDir}"
println "*************************************************"
def dependencyJars = [
"commons.utils", "commons.api", "commons.cluster","commons.netty", "commons.zookeeper", "commons.hadoop-framework", "queuengin", "sparkngin",
"jackson-core-2.2.2", "jackson-databind", "jackson-annotations", "jcommander", "reflections", "guava", "javassist",
'guice', 'javax.inject', 'hazelcast', 'aopalliance',
"kafka", "scala-library",
'zookeeper', 'zkclient',
"netty-all", 'jzlib', 'chronicle', "lang-6.1.4",
"hadoop-common", "hadoop-hdfs", "hadoop-auth",
"hadoop-yarn-api", "hadoop-yarn-common", "hadoop-yarn-client",
"protobuf",
"metrics-core", "metrics-json", "metrics-annotation",
"commons-collections", "commons-configuration","commons-lang", "commons-cli",
"log4j", "slf4j-api", "slf4j-log4j12", "commons-logging"
] ;
println "Copy the dependency library"
configurations.compile.each { File file ->
if(isIn(dependencyJars, file)) {
println " Copy $file.name to DemandSpike/libs"
copy {
from file
into "${releaseDir}/libs"
}
} else {
//println "Ignore $file.name "
}
}
copy {
from "${buildDir}/libs"
into "${releaseDir}/libs"
}
println "Copy and override app"
copy {
from "src/app"
into "${releaseDir}"
}
}
task createYarnAppHome(dependsOn: 'build') << {
def appHomeDir = "${buildDir}/DemandSpike"
createYarnAppHome(appHomeDir)
}
def createYarnAppHome(String appHomeDir) {
println "\n\n"
println "*************************************************"
println "Preparing the app home directory ${appHomeDir}"
println "*************************************************"
def jars = [
"commons.utils", "commons.netty", "commons.hadoop-framework",
"jackson-core-2.2.2", "jackson-databind", "jackson-annotations", "jcommander", "netty-all", "compiler-0.8.16"
]
println "Copy the dependencies library"
configurations.compile.each { File file ->
if(isIn(jars, file)) {
println " Copy $file.name to $appHomeDir"
copy {
from file
into "${appHomeDir}/libs"
}
}
}
copy {
from "${buildDir}/libs"
into "${appHomeDir}/libs"
}
}
def isIn(set, File file) {
for(item in set) {
if(file.name.startsWith(item)) return true ;
}
return false ;
}