forked from h2oai/h2o-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
227 lines (194 loc) · 6.14 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
//
// The top-level h2o-dev project does not have any java pieces itself, but
// apply from the standard java.gradle so that 'gradle idea' generates IDE
// files with the right settings.
//
// The top-level h2o-dev.jar file that gets produced is empty and not usable
// for anything. Use the jar file produced by the h2o-assembly subproject.
//
apply from: 'gradle/java.gradle'
// For multiproject setup we have to apply release plugin here (we share same release number cross all modules)
apply from: 'gradle/release.gradle'
// Print out time taken for each task so we find things that are slow.
apply from: 'gradle/timing.gradle'
// The build script settings to fetch plugins and put them on
// classpath
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.2'
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7.1'
classpath 'com.github.townsfolk:gradle-release:1.2'
classpath 'de.undercouch:gradle-download-task:1.1'
classpath 'joda-time:joda-time:2.2'
classpath 'com.adaptc.gradle:nexus-workflow:0.6'
}
}
//
// Common configuration
//
ext {
//
// All published projects - their artifacts are going to Maven central
publishedProjects = [
project(':h2o-core'),
project(':h2o-algos'),
project(':h2o-web'),
project(':h2o-app'),
project(':h2o-scala'),
project(':h2o-persist-hdfs')
]
javaProjects = [
project(':h2o-core'),
project(':h2o-algos'),
project(':h2o-web'),
project(':h2o-app'),
project(':h2o-persist-hdfs'),
project(':h2o-test-integ')
]
scalaProjects = [
project(':h2o-scala')
]
rProjects = [
project(':h2o-r')
]
pythonProjects = [
project(':h2o-py')
]
//
// Versions of libraries shared cross all projects
//
junitVersion = '4.11'
jets3tVersion = '0.7.1'
awsJavaSdkVersion = '1.8.3'
}
//
// For all projects (this and all subprojects) specify common properties and tasks
//
allprojects {
group = 'ai.h2o'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply from: "$rootDir/gradle/artifacts.gradle"
}
// Compute applyFindbugsPlugin property
// Gradle by default interpret boolean properties setup in config file as strings.
// Hence we need here string toBoolean call
def applyFindbugsPlugin = rootProject.hasProperty("runFindbugs") ? rootProject.runFindbugs.toBoolean() : false
//
// Common configuration for all subprojects
//
subprojects {
// All project inherits the same versioning number
version = rootProject.version
repositories {
mavenCentral()
maven {
url "https://repository.cloudera.com/artifactory/cloudera-repos/"
}
maven {
url "http://repo.hortonworks.com/content/repositories/releases/"
}
maven {
url "http://repo.hortonworks.com/content/repositories/jetty-hadoop/"
}
maven {
url "http://repository.mapr.com/maven/"
}
// mavenLocal()
}
// Publish artifacts - we should filter subproject in future but now apply publisher plugin
// to all projects
if (project in publishedProjects) {
apply from: "$rootDir/gradle/publish.gradle"
}
apply from: "$rootDir/gradle/makeSupport.gradle"
//
// Early configuration of projects simplifies build resolution
//
// Configure Java projects
if (project in javaProjects) {
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/cp.gradle"
// Include Findbugs only if the property is specified
if (applyFindbugsPlugin) {
apply from: "$rootDir/gradle/findbugs.gradle"
}
}
// Configure Scala projects
if (project in scalaProjects) {
apply from: "$rootDir/gradle/scala.gradle"
apply from: "$rootDir/gradle/cp.gradle"
}
if (project in rProjects) {
apply from: "$rootDir/gradle/r.gradle"
}
if (project in pythonProjects) {
apply from: "$rootDir/gradle/r.gradle" // same plugins
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
//
// Setup global properties shared by all projects
//
ext {
// Collect all artifacts produced by all projects in this project - all "archives" artifacts
allArchives = subprojects.findAll().inject(
files(), { acc, pj ->
if (pj in publishedProjects)
acc + pj.configurations.archives.allArtifacts.getFiles()
else
acc
})
// Collect all test artifacts
allTestArchives = files() // filed lazily below
}
// After evaluation of all projects collect all artifacts produced by testArchives configuration
subprojects {
afterEvaluate( { pj ->
def testCnf = pj.configurations.findAll().find({ it.getName().equals("testArchives") })
if (testCnf != null) allTestArchives = allTestArchives + testCnf.allArtifacts.getFiles()
} )
}
// Include support for S3 syncing
apply from: "gradle/s3sync.gradle"
// This task is used by the Jenkins on test.h2o.ai.
//
// It creates a directory called 'target', copies everything to be released
// there, and everything in that directory gets uploaded to S3.
//
// See ~jenkins/bin/buildh2odev.sh.
task buildH2oDevDist(type: Exec) {
group='Dist'
H2OBuildVersion bv = new H2OBuildVersion(rootDir, version);
def projectVersion = bv.getProjectVersion()
def branchName = bv.getBranch()
def buildNumber = bv.getBuildNumber()
def lastCommitHash = bv.getLastCommitHash()
environment['PROJECT_VERSION'] = projectVersion
environment['BRANCH_NAME'] = branchName
environment['BUILD_NUMBER'] = buildNumber
environment['LAST_COMMIT_HASH'] = lastCommitHash
commandLine './make-dist.sh'
}
task dist(dependsOn: buildH2oDevDist)
//
// Additional clean tasks to get squeaky clean.
//
task cleanH2oDistTmp(type: Delete) {
delete "$rootDir/h2o-dist/tmp"
}
task cleanTarget(type: Delete) {
delete "$rootDir/target"
}
clean.dependsOn cleanH2oDistTmp
clean.dependsOn cleanTarget
//
// Import project development profiles
//
apply from: "gradle/profiles.gradle"