2019-04-21 06:11:39 +00:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
2019-04-21 06:36:44 +00:00
|
|
|
/*
|
2019-04-21 06:11:39 +00:00
|
|
|
|
2019-04-21 06:36:44 +00:00
|
|
|
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
|
|
|
|
dependents of `-core` to compile and work with WorldEdit's API.
|
|
|
|
|
|
|
|
*/
|
2019-04-26 05:11:46 +00:00
|
|
|
configure(subprojects + project("core:ap")) {
|
2019-04-21 06:11:39 +00:00
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
|
|
|
configurations {
|
|
|
|
create("shade")
|
2019-04-21 06:33:54 +00:00
|
|
|
getByName("archives").extendsFrom(getByName("default"))
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group = rootProject.group + ".worldedit-libs"
|
|
|
|
|
|
|
|
tasks.register("jar", ShadowJar) {
|
|
|
|
configurations = [project.configurations.shade]
|
|
|
|
classifier = ""
|
|
|
|
|
2019-04-21 07:01:06 +00:00
|
|
|
dependencies {
|
|
|
|
exclude(dependency("com.google.guava:guava"))
|
|
|
|
exclude(dependency("com.google.code.gson:gson"))
|
|
|
|
exclude(dependency("org.checkerframework:checker-qual"))
|
|
|
|
}
|
|
|
|
|
2019-04-21 06:11:39 +00:00
|
|
|
relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text')
|
|
|
|
}
|
|
|
|
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
|
|
|
|
artifact.extension = 'jar'
|
|
|
|
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 {
|
|
|
|
altConfigFiles('sources')
|
|
|
|
}
|
|
|
|
def filePattern = ~'(.*)net/kyori/text((?:/|$).*)'
|
|
|
|
def textPattern = ~/net\.kyori\.text/
|
|
|
|
eachFile {
|
|
|
|
it.filter { String line ->
|
|
|
|
line.replaceFirst(textPattern, 'com.sk89q.worldedit.util.formatting.text')
|
|
|
|
}
|
|
|
|
it.path = it.path.replaceFirst(filePattern, '$1com/sk89q/worldedit/util/formatting/text$2')
|
|
|
|
}
|
|
|
|
classifier = "sources"
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
add("default", jar)
|
2019-04-21 06:33:54 +00:00
|
|
|
add("archives", sourcesJar)
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("install", Upload) {
|
2019-04-21 06:33:54 +00:00
|
|
|
configuration = configurations.archives
|
2019-04-21 06:11:39 +00:00
|
|
|
repositories.mavenInstaller {
|
|
|
|
pom.version = project.version
|
|
|
|
pom.artifactId = project.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifactoryPublish {
|
|
|
|
publishConfigs('default')
|
|
|
|
}
|
|
|
|
|
|
|
|
build.dependsOn(jar, sourcesJar)
|
|
|
|
}
|
|
|
|
|
|
|
|
project("core") {
|
2019-04-26 05:11:46 +00:00
|
|
|
def pistonVersion = '0.0.1-SNAPSHOT'
|
|
|
|
|
2019-04-21 06:11:39 +00:00
|
|
|
dependencies {
|
|
|
|
shade 'net.kyori:text-api:2.0.0'
|
|
|
|
shade 'net.kyori:text-serializer-gson:2.0.0'
|
|
|
|
shade 'net.kyori:text-serializer-legacy:2.0.0'
|
2019-04-21 06:33:54 +00:00
|
|
|
shade('com.sk89q:jchronic:0.2.4a') {
|
|
|
|
exclude(group: "junit", module: "junit")
|
|
|
|
}
|
2019-04-21 06:11:39 +00:00
|
|
|
shade 'com.thoughtworks.paranamer:paranamer:2.6'
|
|
|
|
shade 'com.sk89q.lib:jlibnoise:1.0.0'
|
2019-04-26 05:11:46 +00:00
|
|
|
shade "org.enginehub.piston:core:$pistonVersion"
|
|
|
|
shade "org.enginehub.piston.core-ap:runtime:$pistonVersion"
|
|
|
|
shade "org.enginehub.piston:default-impl:$pistonVersion"
|
|
|
|
}
|
|
|
|
|
|
|
|
project("ap") {
|
|
|
|
dependencies {
|
|
|
|
shade "org.enginehub.piston.core-ap:annotations:$pistonVersion"
|
|
|
|
shade "org.enginehub.piston.core-ap:processor:$pistonVersion"
|
|
|
|
}
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
project("bukkit") {
|
|
|
|
dependencies {
|
2019-04-22 12:05:20 +00:00
|
|
|
shade 'net.kyori:text-adapter-bukkit:2.0.0-SNAPSHOT'
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
project("sponge") {
|
|
|
|
dependencies {
|
2019-04-22 12:05:20 +00:00
|
|
|
shade 'net.kyori:text-adapter-spongeapi:2.0.0-SNAPSHOT'
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("build") {
|
|
|
|
dependsOn(subprojects.collect { it.tasks.named("build") })
|
|
|
|
}
|