2019-07-11 07:33:21 +08:00
|
|
|
import org.ajoberstar.grgit.Grgit
|
|
|
|
|
2020-02-22 13:50:26 +08:00
|
|
|
plugins {
|
|
|
|
id("org.enginehub.codecov")
|
|
|
|
jacoco
|
|
|
|
}
|
|
|
|
|
2019-07-14 13:16:16 +08:00
|
|
|
logger.lifecycle("""
|
2019-07-11 07:33:21 +08:00
|
|
|
*******************************************
|
|
|
|
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
|
|
|
|
*******************************************
|
|
|
|
""")
|
|
|
|
|
2020-02-22 13:50:26 +08:00
|
|
|
applyCommonConfiguration()
|
2019-07-11 07:33:21 +08:00
|
|
|
applyRootArtifactoryConfig()
|
|
|
|
|
2020-02-22 13:50:26 +08:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2019-07-11 07:33:21 +08:00
|
|
|
if (!project.hasProperty("gitCommitHash")) {
|
|
|
|
apply(plugin = "org.ajoberstar.grgit")
|
|
|
|
ext["gitCommitHash"] = try {
|
2020-06-30 03:17:23 +08:00
|
|
|
extensions.getByName<Grgit>("grgit").head()?.abbreviatedId
|
2019-07-11 07:33:21 +08:00
|
|
|
} catch (e: Exception) {
|
2019-07-14 13:16:16 +08:00
|
|
|
logger.warn("Error getting commit hash", e)
|
2019-07-11 07:33:21 +08:00
|
|
|
|
2020-02-11 08:49:40 +08:00
|
|
|
"no.git.id"
|
2019-07-11 07:33:21 +08:00
|
|
|
}
|
|
|
|
}
|