mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-18 11:35:14 +01:00
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
plugins {
|
|
id("com.github.johnrengelman.shadow")
|
|
}
|
|
|
|
val platforms = setOf(
|
|
projects.viabackwardsBukkit,
|
|
projects.viabackwardsBungee,
|
|
projects.viabackwardsFabric,
|
|
projects.viabackwardsSponge,
|
|
projects.viabackwardsVelocity
|
|
).map { it.dependencyProject }
|
|
|
|
tasks {
|
|
shadowJar {
|
|
archiveClassifier.set("")
|
|
archiveFileName.set("ViaBackwards-${project.version}.jar")
|
|
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
platforms.forEach { platform ->
|
|
val shadowJarTask = platform.tasks.getByName("shadowJar", ShadowJar::class)
|
|
dependsOn(shadowJarTask)
|
|
dependsOn(platform.tasks.withType<Jar>())
|
|
from(zipTree(shadowJarTask.archiveFile))
|
|
}
|
|
}
|
|
build {
|
|
dependsOn(shadowJar)
|
|
}
|
|
sourcesJar {
|
|
rootProject.subprojects.forEach { subproject ->
|
|
if (subproject == project) return@forEach
|
|
val platformSourcesJarTask = subproject.tasks.findByName("sourcesJar") as? Jar ?: return@forEach
|
|
dependsOn(platformSourcesJarTask)
|
|
from(zipTree(platformSourcesJarTask.archiveFile))
|
|
}
|
|
}
|
|
}
|
|
|
|
publishShadowJar()
|