WorldEdit/build.gradle.kts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

89 lines
2.4 KiB
Plaintext
Raw Normal View History

2019-07-11 07:33:21 +08:00
import org.ajoberstar.grgit.Grgit
2021-06-09 10:18:24 +08:00
// needed for fabric to know where FF executor is....
buildscript {
repositories {
mavenCentral()
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
}
dependencies {
classpath("net.fabricmc:fabric-loom:${versions.loom}")
}
}
plugins {
id("org.enginehub.codecov")
jacoco
}
2021-03-09 03:10:55 +08:00
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"
}
}
// Work around https://github.com/gradle/gradle/issues/4823
subprojects {
if (buildscript.sourceFile?.extension?.toLowerCase() == "kts"
&& parent != rootProject) {
generateSequence(parent) { project -> project.parent.takeIf { it != rootProject } }
.forEach { evaluationDependsOn(it.path) }
}
}
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
*******************************************
""")
applyCommonConfiguration()
2019-07-11 07:33:21 +08:00
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)
}