3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00
FastAsyncWorldEdit/worldedit-libs/build.gradle

140 Zeilen
4.9 KiB
Groovy

2019-06-27 03:34:20 +02:00
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
/*
This project shades <em>API</em> libraries, i.e. those libraries
whose classes are publicly referenced from `-core` classes.
This project <em>does not</em> shade implementation libraries, i.e.
those libraries whose classes are internally depended on.
This is because the main reason for shading those libraries is for
their internal usage in each platform, not because we need them available to
2019-08-19 20:00:37 +02:00
dependents of `-core` to compile and work with WorldEdit"s API.
2019-06-27 03:34:20 +02:00
*/
configure(subprojects + project("core:ap")) {
2019-08-19 20:00:37 +02:00
apply plugin: "maven"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "com.jfrog.artifactory"
2019-06-27 03:34:20 +02:00
configurations {
create("shade")
getByName("archives").extendsFrom(getByName("default"))
}
group = rootProject.group + ".worldedit-libs"
tasks.register("jar", ShadowJar) {
configurations = [project.configurations.shade]
classifier = ""
dependencies {
exclude(dependency("com.google.guava:guava"))
exclude(dependency("com.google.code.gson:gson"))
exclude(dependency("org.checkerframework:checker-qual"))
}
2019-08-19 20:00:37 +02:00
relocate("net.kyori.text", "com.sk89q.worldedit.util.formatting.text")
2019-06-27 03:34:20 +02:00
}
def altConfigFiles = { String artifactType ->
def deps = configurations.shade.incoming.dependencies
.collect { it.copy() }
.collect { dependency ->
dependency.artifact { artifact ->
artifact.name = dependency.name
artifact.type = artifactType
2019-08-19 20:00:37 +02:00
artifact.extension = "jar"
2019-06-27 03:34:20 +02:00
artifact.classifier = artifactType
}
dependency
}
return files(configurations.detachedConfiguration(deps as Dependency[])
.resolvedConfiguration.lenientConfiguration.getArtifacts()
.findAll { it.classifier == artifactType }
.collect { zipTree(it.file) })
}
tasks.register("sourcesJar", Jar) {
from {
2019-08-19 20:00:37 +02:00
altConfigFiles("sources")
2019-06-27 03:34:20 +02:00
}
2019-08-19 20:00:37 +02:00
def filePattern = ~/(.*)net\/kyori\/text((?:\/|\u0024).*)/
2019-06-27 03:34:20 +02:00
def textPattern = ~/net\.kyori\.text/
eachFile {
it.filter { String line ->
2019-08-19 20:00:37 +02:00
line.replaceFirst(textPattern, "com.sk89q.worldedit.util.formatting.text")
2019-06-27 03:34:20 +02:00
}
2019-08-19 20:00:37 +02:00
it.path = it.path.replaceFirst(filePattern, "\$1com/sk89q/worldedit/util/formatting/text\$2")
2019-06-27 03:34:20 +02:00
}
classifier = "sources"
}
artifacts {
add("default", jar)
add("archives", sourcesJar)
}
tasks.register("install", Upload) {
configuration = configurations.archives
repositories.mavenInstaller {
pom.version = project.version
pom.artifactId = project.name
}
}
artifactoryPublish {
2019-08-19 20:00:37 +02:00
publishConfigs("default")
2019-06-27 03:34:20 +02:00
}
build.dependsOn(jar, sourcesJar)
}
def textExtrasVersion = "3.0.2"
project("core") {
def textVersion = "3.0.2"
2019-08-19 20:00:37 +02:00
def pistonVersion = "0.4.4-SNAPSHOT"
2019-06-27 03:34:20 +02:00
dependencies {
shade "net.kyori:text-api:$textVersion"
shade "net.kyori:text-serializer-gson:$textVersion"
shade "net.kyori:text-serializer-legacy:$textVersion"
shade "net.kyori:text-serializer-plain:$textVersion"
shade "net.kyori:text-feature-pagination:$textVersion"
2019-08-19 20:00:37 +02:00
shade("com.sk89q:jchronic:0.2.4a") {
2019-06-27 03:34:20 +02:00
exclude(group: "junit", module: "junit")
}
2019-08-19 20:00:37 +02:00
shade "com.thoughtworks.paranamer:paranamer:2.6"
shade "com.sk89q.lib:jlibnoise:1.0.0"
2019-08-18 00:50:06 +02:00
shade "FAWE-Piston:lastSuccessfulBuild:core/build/libs/core-$pistonVersion@jar"
shade "FAWE-Piston:lastSuccessfulBuild:core-ap/runtime/build/libs/runtime-$pistonVersion@jar"
shade "FAWE-Piston:lastSuccessfulBuild:default-impl/build/libs/default-impl-$pistonVersion@jar"
2019-06-27 03:34:20 +02:00
}
project("ap") {
dependencies {
2019-07-22 22:57:34 +02:00
// def avVersion = "1.6.5"
// shade "com.google.auto.value:auto-value-annotations:$avVersion"
2019-08-18 00:50:06 +02:00
shade "FAWE-Piston:lastSuccessfulBuild:core/build/libs/core-$pistonVersion@jar"
shade "FAWE-Piston:lastSuccessfulBuild:core-ap/annotations/build/libs/annotations-$pistonVersion@jar"
shade "FAWE-Piston:lastSuccessfulBuild:core-ap/processor/build/libs/processor-$pistonVersion@jar"
2019-07-22 22:57:34 +02:00
2019-08-18 00:50:06 +02:00
shade "org.enginehub.piston.core-ap:annotations:$pistonVersion"
shade "org.enginehub.piston.core-ap:processor:$pistonVersion"
2019-06-27 03:34:20 +02:00
}
}
}
project("bukkit") {
repositories {
maven {
name = "SpigotMC"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
dependencies {
shade "net.kyori:text-adapter-bukkit:$textExtrasVersion"
}
}
tasks.register("build") {
dependsOn(subprojects.collect { it.tasks.named("build") })
}