forked from ftsrg/theta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
54 lines (43 loc) · 1.64 KB
/
build.gradle.kts
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
plugins {
base
id("jacoco-common")
id("io.freefair.aggregate-javadoc") version "5.2"
}
buildscript {
val libPath: String by extra { rootProject.projectDir.resolve("lib").path }
extra["execPath"] = "$libPath${File.pathSeparator}${System.getenv("PATH")}"
}
allprojects {
group = "hu.bme.mit.inf.theta"
version = "4.2.2"
apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts"))
}
evaluationDependsOnChildren()
tasks {
val jacocoRootReport by creating(JacocoReport::class) {
group = "verification"
description = "Generates merged code coverage report for all test tasks."
reports {
html.isEnabled = false
xml.isEnabled = true
csv.isEnabled = false
}
val reportTasks = subprojects.mapNotNull { subproject ->
subproject.tasks.named("jacocoTestReport", JacocoReport::class).orNull
}
dependsOn(reportTasks.flatMap { it.dependsOn })
sourceDirectories.setFrom(files(reportTasks.map { it.allSourceDirs }))
classDirectories.setFrom(files(reportTasks.map { it.allClassDirs }))
val allExecutionData = files(reportTasks.map { it.executionData })
// We only set executionData for declaring dependencies during task graph construction,
// subprojects without tests will be filtered out in doFirst.
executionData.setFrom(allExecutionData.filter { it.exists() })
}
// Dummy test task for generating coverage report after ./gradlew test and ./gradlew check.
val test by creating {
finalizedBy(jacocoRootReport)
}
check {
dependsOn(test)
}
}