forked from eclipse-vertx/vert.x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
211 lines (178 loc) · 5.68 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
/*
* Copyright (c) 2011-2013 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
apply from: 'gradle/extra-tasks.gradle'
buildscript {
repositories {
flatDir {
dir 'extralibs'
}
if (System.getenv("VERTX_DISABLE_MAVENLOCAL") == null) {
// We don't want to use mavenLocal when running on CI - mavenLocal is only useful in Gradle for
// publishing artifacts locally for development purposes - maven local is also not threadsafe when there
// are concurrent builds
mavenLocal()
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:1.1'
}
}
apply plugin: 'js'
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 {
if (System.getenv("VERTX_DISABLE_MAVENLOCAL") == null) {
mavenLocal()
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
testCompile "junit:junit:$junitVersion"
testCompile "io.vertx:vertx-testframework:$testframeworkversion", {
exclude group: "io.vertx"
exclude group: "junit"
}
testCompile "io.vertx:testtools:$toolsVersion", {
exclude group: "io.vertx"
exclude group: "junit"
}
}
javadoc {
destinationDir = file("build/docs/java/api")
options.encoding = 'UTF-8'
}
task collectDeps(type: Copy) {
destinationDir = file("build/deps")
into("compile") {
from configurations.compile
exclude "vertx-*.jar"
}
into("test") {
from configurations.testCompile
exclude "vertx-*.jar"
}
}
}
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: [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')
rename ('vertxbus.js', "vertxbus-${vertxbusjsVersion}.js")
}
into('conf') {
from file('vertx-platform/src/main/resources')
rename ('default-repos.txt', 'repos.txt')
rename ('default-langs.properties', 'langs.properties')
rename ('default-cluster.xml', 'cluster.xml')
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens:[version: rootProject.version])
exclude "**/META_INF/**"
}
into('lib') {
from subprojects.configurations.compile
from subprojects.jar
// Don't just include everything!!
includes = ["jackson*.jar", "netty*.jar", "hazelcast*.jar", "vertx*.jar"]
}
doLast {
project.ant.chmod(file: "build/$rootProject.name-$version/bin", perm: 'ugo+x')
}
}
task minifyClient(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
outputs.upToDateWhen { false }
source = file("build/$rootProject.name-$version/client/vertxbus.js")
dest = file("build/$rootProject.name-$version/client/vertxbus-${vertxbusjsVersion}.min.js")
closure {
warningLevel = 'QUIET'
}
}
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)
excludes = ["**/impl/**"]
includes = ["**/core/**", "**/platform/**"]
destinationDir file("build/${rootProject.name}-$version/api-docs/java/api")
inputs.files classpath
outputs.dir destinationDir
}
task createDocs(dependsOn: [subprojects.classes, 'javadocs']) {
group = 'vert.x'
description = 'Build all of the various docs for the project'
}
task distZip(type: Zip, dependsOn : ['assemble', 'minifyClient', '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', 'minifyClient', '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'
}