forked from eclipse-vertx/vert.x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
258 lines (218 loc) · 6.46 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
/*
* Copyright 2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: 'gradle/extra-tasks.gradle'
buildscript {
repositories {
// mavenLocal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
classpath "org.vert-x:build-tools:$vertxBuildToolsVersion"
}
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
configurations {
platform
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
defaultTasks = ['classes']
group = rootProject.group
repositories {
mavenCentral()
}
dependencies {
testCompile "junit:junit:$junitVersion"
}
javadoc {
destinationDir = file("build/docs/java/api")
}
task collectDeps(type: Copy) {
destinationDir = file("build/deps")
into("compile") {
from configurations.compile
exclude "vertx-*.jar"
}
into("test") {
from configurations.testCompile
exclude "vertx-*.jar"
}
}
}
defaultTasks = ['preflight']
task preflight(dependsOn: subprojects.collectDeps) {
group = null
description = null
}
task test(dependsOn: [subprojects.test]) {
group = null
description = null
}
task clean(type: Delete, dependsOn: [subprojects.clean]) {
group = 'build'
description 'Clean the parent and all of the vert.x subprojects'
delete 'build'
subprojects.each {
delete 'build/deps'
}
}
task assemble(type: Copy, dependsOn: ['preflight', subprojects.assemble]) {
group = 'vert.x'
description 'Build the parent and all of the vert.x subprojects'
destinationDir file("build/$rootProject.name-$version")
outputs.dir destinationDir
into('bin') {
from file('src/dist/scripts')
// fileMode 755
}
into('client') {
from file('src/dist/client')
}
into('conf') {
from file('src/dist/conf')
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens:[version: rootProject.version])
}
into('examples') {
from file("vertx-examples/src/main")
exclude "**/vertx-dev*"
}
into('examples/java/eventbusbridge') {
from file("src/dist/client/vertxbus.js")
}
into('examples/groovy/eventbusbridge') {
from file("src/dist/client/vertxbus.js")
}
into('examples/javascript/eventbusbridge') {
from file("src/dist/client/vertxbus.js")
}
into('examples/python/eventbusbridge') {
from file("src/dist/client/vertxbus.js")
}
into('examples/ruby/eventbusbridge') {
from file("src/dist/client/vertxbus.js")
}
into('examples/groovy/webapp/web/js') {
from file("src/dist/client/vertxbus.js")
}
into('examples/javascript/webapp/web/js') {
from file("src/dist/client/vertxbus.js")
}
into('examples/python/webapp/web/js') {
from file("src/dist/client/vertxbus.js")
}
into('examples/ruby/webapp/web/js') {
from file("src/dist/client/vertxbus.js")
}
into('lib') {
from subprojects.configurations.platform
from subprojects.configurations.compile
// Don't just include everything!!
includes = ["groovy*.jar", "jackson*.jar", "rhino*.jar", "netty*.jar", "hazelcast*.jar", "vertx*.jar"]
}
doLast {
project.ant.chmod(file: "build/$rootProject.name-$version/bin", perm: 'ugo+x')
}
}
task javadocs(type: Javadoc, dependsOn: subprojects.javadoc) {
group = null // hide the task
description = null // hide the task
source = subprojects.sourceSets.main.java
classpath = files(subprojects.configurations.compile)
destinationDir file("build/$rootProject.name-$version/api-docs/java/api")
inputs.files classpath
outputs.dir destinationDir
}
task nonJavadocs(type: Copy) {
group = null // hide the task
description = null // hide the task
destinationDir file("build/$rootProject.name-$version/api-docs")
inputs.files subprojects.docsDir
outputs.dir destinationDir
doFirst {
['groovy/api', 'javascript/api', 'python/api', 'ruby/api'].each { dir->
mkdir("$rootDir/build/$rootProject.name-$version/api-docs/$dir")
}
}
// TODO make this less ugly
into('groovy') {
from file('vertx-lang/vertx-lang-groovy/build/docs/groovy')
}
into('python') {
from file('vertx-lang/vertx-lang-jython/build/docs/python')
}
into('ruby') {
from file('vertx-lang/vertx-lang-jruby/build/docs/ruby')
}
into('javascript') {
from file('vertx-lang/vertx-lang-rhino/build/docs/javascript')
}
}
task createDocs(dependsOn: [subprojects.classes, 'javadocs', 'nonJavadocs']) {
group = 'vert.x'
description = 'Build all of the various docs for the project'
}
task installApp(type: Sync, dependsOn: ['assemble']) {
group = 'vert.x'
description 'Install a local copy of this build'
def vertxTemp = file(System.getProperty('java.io.tmpdir') + "/vertx-$version")
destinationDir vertxTemp
inputs.files files("build/$rootProject.name-$version")
outputs.dir destinationDir
from "build/$rootProject.name-$version"
}
task distZip(type: Zip, dependsOn : ['assemble', 'createDocs']) {
group = 'vert.x'
description 'Create the Zip distribution'
destinationDir file('build/distributions')
baseName = rootProject.name
version = rootProject.version
from 'build'
include "$rootProject.name-$version/**"
}
task distTar(type: Tar, dependsOn: ['assemble', 'createDocs']) {
group = 'vert.x'
description 'Create the GZIP distribution'
compression = org.gradle.api.tasks.bundling.Compression.GZIP
destinationDir file('build/distributions')
inputs.files files("build/$rootProject.name-$version")
outputs.dir destinationDir
baseName = rootProject.name
version = rootProject.version
extension = 'tar.gz'
from 'build'
include "$rootProject.name-$version/**"
}
task dist(dependsOn: ['distTar', 'distZip']){
group = 'vert.x'
description 'Create distributions - tar.gz and zip'
}
task release(dependsOn: ['clean', 'test', 'dist']) {
group = 'vert.x'
description 'Clean and fully test the current version before creating the distribution'
}
/*
* TODO add Git tasks for tagging a release
* TODO add Git tasks for publishing binaries to master
* TODO add Git tasks for updating documentation on website
* (@see EGit)
*
*/