forked from TestFX/TestFX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
190 lines (162 loc) · 5.47 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
/*
* Copyright 2013-2014 SmartBear Software
* Copyright 2014-2015 The TestFX Contributors
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by the
* European Commission - subsequent versions of the EUPL (the "Licence"); You may
* not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the Licence for the
* specific language governing permissions and limitations under the Licence.
*/
// task to add gradle wrapper files.
task wrapper(type: Wrapper) {
gradleVersion = "2.3"
}
// task to print gradle and groovy versions.
task printVersions << {
println "Gradle version: " + project.gradle.gradleVersion
println "Groovy version: " + GroovySystem.version
}
allprojects { project ->
// task to create main and test source directories.
task createSourceDirs << {
if (project != rootProject) {
sourceSets*.allSource.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
}
// create build date and time.
import java.text.SimpleDateFormat
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat("yyyy-MM-dd").format(buildTimeAndDate)
buildTime = new SimpleDateFormat("HH:mm:ss.SSSZ").format(buildTimeAndDate)
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
}
}
apply plugin: "base"
apply plugin: "idea"
subprojects { subproject ->
// provide java configurations and tasks.
apply plugin: "java"
//apply from: rootProject.file("gradle/check-checkstyle.gradle")
//apply from: rootProject.file("gradle/check-findbugs.gradle")
//apply from: rootProject.file("gradle/check-jdepend.gradle")
apply from: rootProject.file("gradle/check-license.gradle")
apply from: rootProject.file("gradle/publish-jar.gradle")
apply from: rootProject.file("gradle/publish-maven.gradle")
apply from: rootProject.file("gradle/publish-bintray.gradle")
task sourceJar(type: Jar) {
group "Build"
description "An archive of the source code"
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
group "Build"
description "An archive of the javadoc"
classifier "javadoc"
from javadoc
}
jar.finalizedBy sourceJar
jar.finalizedBy javadocJar
artifacts {
sourceJar
javadocJar
}
// source code compatible to java 8.
subproject.tasks.withType(JavaCompile) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
// configure javadoc task.
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption("Xdoclint:none", "-quiet")
}
}
// use utf-8 encoding for java compile.
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}
evaluationDependsOnChildren()
subprojects { subproject ->
// maven repositories for dependencies.
repositories {
if (project.hasProperty("useMavenLocal")) {
mavenLocal()
}
jcenter()
}
// configure javadoc task.
javadoc {
excludes = ["**/*.html", "META-INF/**"]
options.use = true
options.splitIndex = true
options.encoding = "UTF-8"
options.author = true
options.version = subproject.sourceCompatibility
options.windowTitle = "${subproject.pomDescription} ${version} API"
options.docTitle = "${subproject.pomDescription} ${version} API"
options.footer = project.javadocFooter
options.links = [
"http://docs.oracle.com/javase/8/docs/api/",
"http://docs.oracle.com/javase/8/javafx/api/"
]
}
}
task aggregateJavadoc(type: Javadoc) {
group "Documentation"
description "Generates aggregated Javadoc API documentation."
def javadocSubprojects = subprojects.findAll { project ->
project.sourceSets.main.allJava.matching { include "org/testfx/**" }.with { !it.empty }
}
source javadocSubprojects.collect { project ->
project.sourceSets.main.allJava
}
classpath = files(javadocSubprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
title "${project.javadocName} ${project.version} API"
destinationDir = new File(projectDir, "docs/javadoc")
configure(options) {
use = true
splitIndex = true
encoding = "UTF-8"
links = [
"http://docs.oracle.com/javase/8/docs/api/",
"http://docs.oracle.com/javase/8/javafx/api/"
]
}
// disable java 8 overly pedantic lint checking.
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption("Xdoclint:none", "-quiet")
}
doFirst {
project.delete(destinationDir)
logger.info "Title : ${options.windowTitle}"
logger.info "Destdir : ${destinationDir}"
}
}
// configure java jdk and language level in idea.
idea {
project {
jdkName "1.8"
languageLevel "1.8"
}
}