3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 09:10:10 +01:00
ViaVersion/universal/build.gradle.kts
Jason 87d54f1103
Clean up build scripts using new Gradle features (#2436)
* Make use of `TYPESAFE_PROJECT_ACCESSORS` and `VERSION_CATALOGS` Gradle feature previews to clean up build scripts

* Bump setup-java action to v2, specify AdoptOpenJDK distribution
2021-04-14 14:16:48 +02:00

30 Zeilen
1.0 KiB
Plaintext

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("com.github.johnrengelman.shadow")
}
tasks {
withType<ShadowJar> {
archiveClassifier.set("")
archiveFileName.set("ViaVersion-${project.version}.jar")
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
sequenceOf(
rootProject.projects.viaversionBukkit,
rootProject.projects.viaversionBungee,
rootProject.projects.viaversionFabric,
rootProject.projects.viaversionSponge,
rootProject.projects.viaversionVelocity,
).map { it.dependencyProject }.forEach { subproject ->
val shadowJarTask = subproject.tasks.getByName("shadowJar", ShadowJar::class)
dependsOn(shadowJarTask)
dependsOn(subproject.tasks.withType<Jar>())
from(zipTree(shadowJarTask.archiveFile))
}
}
build {
dependsOn(withType<ShadowJar>())
}
}