forked from siwiwit/dolphin-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
209 lines (178 loc) · 6.8 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
/*
* Copyright 2015-2018 Canoo Engineering AG.
*
* 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.
*/
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'org.kordamp.gradle:stats-gradle-plugin:0.2.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'net.nemerosa:versioning:2.6.1'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'com.adarshr:gradle-test-logger-plugin:1.1.2'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1'
}
}
if (project.hasProperty('sonarToken')) {
System.setProperty("sonar.login", project.getProperty("sonarToken"))
}
apply plugin: 'net.nemerosa.versioning'
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
buildRevision = versioning.info.commit
projectsWithCoverage = []
baseJaCocoDir = "${buildDir}/reports/jacoco/test/"
jacocoMergeExecFile = "${baseJaCocoDir}jacocoTestReport.exec"
jacocoMergeReportHTMLFile = "${baseJaCocoDir}/html/"
jacocoMergeReportXMLFile = "${baseJaCocoDir}/jacocoTestReport.xml"
depProjects = []
infoFilePatterns = '**/build.properties'
}
allprojects {
apply plugin: 'base'
apply plugin: 'idea'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.adarshr.test-logger'
repositories {
jcenter()
mavenLocal()
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
jacoco {
toolVersion = jacocoVersion
}
subprojects { subprj ->
apply plugin: 'java'
apply plugin: 'org.kordamp.gradle.stats'
apply from: rootProject.file('gradle/code-quality.gradle')
subprj.tasks.withType(JavaCompile) {
sourceCompatibility = subprj.sourceCompatibility
targetCompatibility = subprj.targetCompatibility
}
test.useTestNG()
if (!subprj.publishJars.toBoolean()) {
sonarqube {
sonarqube {
skipProject = true
}
}
} else {
subprj.apply from: rootProject.file('gradle/publishing.gradle')
subprj.apply from: rootProject.file('gradle/code-coverage.gradle')
sonarqube {
sonarqube {
properties {
property "sonar.exclusions", "**/*Exception.java"
}
}
}
javadoc {
excludes = ['**/*.html', 'META-INF/**']
options.use = true
options.splitIndex = true
options.encoding = 'UTF-8'
options.author = true
options.version = true
options.windowTitle = "$project.name $project.version API"
options.docTitle = "$project.name $project.version API"
options.links = ['http://docs.oracle.com/javase/8/docs/api/',
'http://docs.oracle.com/javase/8/javafx/api/',
'https://canoo.github.io/dolphin-platform/javadoc/core/',
'https://canoo.github.io/dolphin-platform/javadoc/client/',
'https://canoo.github.io/dolphin-platform/javadoc/client-jfx/',
'https://canoo.github.io/dolphin-platform/javadoc/server/',
'https://canoo.github.io/dolphin-platform/javadoc/server-spring/',
'https://canoo.github.io/dolphin-platform/javadoc/server-jee/']
if (subprj.file('src/main/javadoc/overview.html').exists()) {
options.overview = file('src/main/javadoc/overview.html')
}
doLast {
copy {
from file('src/main/javadoc')
into javadoc.destinationDir
include '**/doc-files/*'
}
}
}
task sourcesJar(type: Jar) {
group 'Build'
description 'An archive of the source code'
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
group 'Build'
description 'An archive of the javadoc'
classifier 'javadoc'
from javadoc.destinationDir
}
jar.finalizedBy sourcesJar
jar.finalizedBy javadocJar
artifacts {
sourcesJar
javadocJar
}
dependencies {
compile "org.slf4j:slf4j-api:$slf4jVersion"
testCompile "org.testng:testng:$testngVersion"
testCompile 'org.hamcrest:java-hamcrest:2.0.0.0'
testCompile "org.jmockit:jmockit:$jmockitVersion"
}
}
}
evaluationDependsOnChildren()
subprojects {
task allDeps(type: DependencyReportTask) {}
}
coveralls {
sourceDirs = files(projectsWithCoverage.sourceSets.main.allSource.srcDirs).files.absolutePath
}
task jacocoRootMerge(type: org.gradle.testing.jacoco.tasks.JacocoMerge) {
dependsOn = projectsWithCoverage.test
dependsOn = projectsWithCoverage.jacocoTestReport
executionData = files(projectsWithCoverage.jacocoTestReport.executionData)
destinationFile = file(jacocoMergeExecFile)
}
task jacocoRootMergeReport(dependsOn: jacocoRootMerge, type: JacocoReport) {
group = 'Reporting'
description = 'Aggregate Jacoco coverage reports.'
additionalSourceDirs = files(projectsWithCoverage.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(projectsWithCoverage .sourceSets.main.allSource.srcDirs)
classDirectories = files(projectsWithCoverage.sourceSets.main.output)
executionData = files(jacocoRootMerge.destinationFile)
reports {
html.enabled = true
xml.enabled = true
html.destination = file(jacocoMergeReportHTMLFile)
xml.destination = file(jacocoMergeReportXMLFile)
}
}