-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
47 lines (40 loc) · 1.65 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
plugins {
id 'test-report-aggregation'
}
reporting {
reports {
testAggregateTestReport(AggregateTestReport) {
testType = TestSuiteType.UNIT_TEST
}
}
}
// pass common tasks through to included builds
['assemble', 'build', 'clean', 'licenseFormatMain', 'licenseFormatTest', 'spotlessApply', 'publishToMavenLocal', 'release'].each { registerTaskForRepo it }
def registerTaskForRepo(taskName) {
tasks.register(taskName) {
group = 'ForAll'
gradle.includedBuilds.stream()
.filter(build -> build.projectDir.toPath().resolve('build.gradle').toFile().text.contains('id \'de.featjar.'))
.forEach(build -> dependsOn build.task(":$taskName"))
}
}
tasks.register('format') {
group = 'ForAll'
finalizedBy spotlessApply, licenseFormatMain, licenseFormatTest
}
tasks.register('testEach') {
gradle.includedBuilds.stream()
.filter(build -> build.projectDir.toPath().resolve('build.gradle').toFile().text.contains('id \'de.featjar.'))
.forEach(build -> dependsOn build.task(":test"))
}
tasks.register('test') {
group = 'ForAll'
dependsOn assemble, testEach
testEach.mustRunAfter assemble
doLast {
String url1 = "file://" + project.buildDir + "/reports/tests/unit-test/aggregated-results/index.html"
String url2 = "file://" + project.buildDir + "/reports/spotbugs/main.html"
String url3 = "file://" + project.buildDir + "/reports/spotbugs/test.html"
println "See the reports at:\n\u001B]8;;${url1}\u001B\\${url1}\u001B]8;;\u001B\\\n\u001B]8;;${url2}\u001B\\${url2}\u001B]8;;\u001B\\\n\u001B]8;;${url3}\u001B\\${url3}\u001B]8;;\u001B\\"
}
}