3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-18 14:00:11 +01:00
ViaBackwards/universal/build.gradle.kts

42 Zeilen
1.3 KiB
Plaintext

2021-02-23 11:29:18 +01:00
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2021-05-29 09:32:55 +02:00
plugins {
id("com.github.johnrengelman.shadow")
}
val platforms = setOf(
projects.viabackwardsBukkit,
projects.viabackwardsBungee,
projects.viabackwardsFabric,
projects.viabackwardsSponge,
projects.viabackwardsVelocity
).map { it.dependencyProject }
2021-02-18 14:34:33 +01:00
tasks {
2021-05-29 09:32:55 +02:00
shadowJar {
2021-02-18 14:34:33 +01:00
archiveClassifier.set("")
archiveFileName.set("ViaBackwards-${project.version}.jar")
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
2021-05-29 09:32:55 +02:00
platforms.forEach { platform ->
val shadowJarTask = platform.tasks.getByName("shadowJar", ShadowJar::class)
2021-02-18 14:34:33 +01:00
dependsOn(shadowJarTask)
2021-05-29 09:32:55 +02:00
dependsOn(platform.tasks.withType<Jar>())
from(zipTree(shadowJarTask.archiveFile))
2021-02-18 14:34:33 +01:00
}
}
build {
2021-05-29 09:32:55 +02:00
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))
}
2021-02-23 11:29:18 +01:00
}
2021-02-18 14:34:33 +01:00
}
2021-05-29 09:32:55 +02:00
publishShadowJar()