-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
66 lines (57 loc) · 1.78 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
55
56
57
58
59
60
61
62
63
64
65
66
import org.ajoberstar.grgit.Grgit
plugins {
id("org.enginehub.codecov")
jacoco
}
logger.lifecycle("""
*******************************************
You are building WorldEdit!
If you encounter trouble:
1) Read COMPILING.md if you haven't yet
2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle
4) If you still need help, ask on Discord! https://discord.gg/enginehub
Output files will be in [subproject]/build/libs
*******************************************
""")
applyCommonConfiguration()
applyRootArtifactoryConfig()
val totalReport = tasks.register<JacocoReport>("jacocoTotalReport") {
for (proj in subprojects) {
proj.apply(plugin = "jacoco")
proj.plugins.withId("java") {
executionData(
fileTree(proj.buildDir.absolutePath).include("**/jacoco/*.exec")
)
sourceSets(proj.the<JavaPluginConvention>().sourceSets["main"])
reports {
xml.isEnabled = true
xml.destination = rootProject.buildDir.resolve("reports/jacoco/report.xml")
html.isEnabled = true
}
dependsOn(proj.tasks.named("test"))
}
}
}
afterEvaluate {
totalReport.configure {
classDirectories.setFrom(classDirectories.files.map {
fileTree(it).apply {
exclude("**/*AutoValue_*")
exclude("**/*Registration.*")
}
})
}
}
codecov {
reportTask.set(totalReport)
}
if (!project.hasProperty("gitCommitHash")) {
apply(plugin = "org.ajoberstar.grgit")
ext["gitCommitHash"] = try {
extensions.getByName<Grgit>("grgit").head()?.abbreviatedId
} catch (e: Exception) {
logger.warn("Error getting commit hash", e)
"no.git.id"
}
}