-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
161 lines (129 loc) · 3.82 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
apply plugin: 'java'
sourceCompatibility = 1.8
allprojects {
apply plugin: 'java'
group = 'com.talentica.hungry-hippos'
version = '0.7.0'
repositories {
mavenCentral()
jcenter()
}
dependencies{
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:1.10.+'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
}
sourceSets {
test {
java.srcDir 'src/test/java'
}
integration {
java.srcDir 'src/test/integration/java'
resources.srcDir 'src/test/resources'
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
jar{
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
configurations {
integrationCompile.extendsFrom testCompile
integrationRuntime.extendsFrom testRuntime
}
task integration(type: Test, description: 'Runs the integration tests.', group: 'Verification') {
testClassesDir = sourceSets.integration.output.classesDir
classpath = sourceSets.integration.runtimeClasspath
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'log4j', name: 'log4j', version: '1.2.16'
}
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
jcenter()
}
dependencies {
classpath 'net.researchgate:gradle-release:2.3.4'
classpath 'no.nils:wsdl2java:0.6'
}
}
apply plugin: 'net.researchgate.release'
release {
failOnUpdateNeeded = false
failOnUnversionedFiles = false
}
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
def cleanupAndMakeDirs(path){
File file= new File(path)
file.mkdirs();
file.list().each { new File(file.getPath(),it).delete() }
}
subprojects{
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
ext.outputLibsDir="build/libs"
ext.outputScriptsDir="src/main/resources/bin"
ext.javaodcDir="build/docs/javadoc"
ext.configDir="src/main/resources/distribution"
ext.distributionHome="../build/distribution/HungryHippos-"+project.version+"/"
ext.apiDir=distributionHome +"docs"
ext.destDir= apiDir+"/"+project.name
ext.librariesDir= distributionHome+"lib"
ext.mapredLibrariesDir=distributionHome +"mapreduce/lib"
ext.mapredApi=distributionHome +"mapreduce/docs"
ext.binDir=distributionHome +"bin"
ext.destConfigDir=distributionHome +"config"
task makeRequiredDirs() {
cleanupAndMakeDirs(librariesDir)
cleanupAndMakeDirs(mapredLibrariesDir)
cleanupAndMakeDirs(mapredApi)
cleanupAndMakeDirs(binDir)
cleanupAndMakeDirs(destConfigDir)
cleanupAndMakeDirs(apiDir)
}
task copyOtherThanMapReduceLibs(dependsOn:[makeRequiredDirs],type:Copy){
from outputLibsDir into librariesDir
exclude { details -> details.file.name.equals('client-api.jar') || details.file.name.contains('orig')}
}
task copyMapReduceLib(dependsOn:[makeRequiredDirs],type:Copy){
from outputLibsDir into mapredLibrariesDir
include 'client-api.jar'
}
task copyShellScripts(dependsOn:[makeRequiredDirs],type:Copy){
from outputScriptsDir into binDir
include "*.sh"
}
task copyMapredApi(dependsOn:[makeRequiredDirs,javadoc],type:Copy){
if(project.name.equals("client-api")){
from javaodcDir into mapredApi
}
}
task copyApi(dependsOn:[makeRequiredDirs,javadoc],type:Copy){
if(!project.name.equals("client-api")){
cleanupAndMakeDirs(destDir)
from javaodcDir into destDir
}
}
task copyConfigurations(dependsOn:[makeRequiredDirs],type:Copy){
from configDir into destConfigDir
}
task buildDistribution(dependsOn:[build,jar,copyConfigurations,copyOtherThanMapReduceLibs,copyMapReduceLib,copyShellScripts,copyMapredApi,copyApi],type:Copy){
}
}