Move shaded libraries to their own artifacts

This commit is contained in:
Kenzie Togami 2019-04-20 23:11:39 -07:00
parent 5b1573a24e
commit 1e7b4fc835
No known key found for this signature in database
GPG Key ID: 5D200B325E157A81
22 changed files with 165 additions and 72 deletions

View File

@ -82,6 +82,14 @@ artifactory {
artifactoryPublish.skip = true artifactoryPublish.skip = true
subprojects { subprojects {
repositories {
mavenCentral()
maven { url "http://maven.sk89q.com/repo/" }
maven { url "http://repo.maven.apache.org/maven2" }
}
}
configure(['core', 'bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) {
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
@ -97,12 +105,6 @@ subprojects {
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml") checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
checkstyle.toolVersion = '7.6.1' checkstyle.toolVersion = '7.6.1'
repositories {
mavenCentral()
maven { url "http://maven.sk89q.com/repo/" }
maven { url "http://repo.maven.apache.org/maven2" }
}
if (JavaVersion.current().isJava8Compatible()) { if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail // Java 8 turns on doclint which we fail
tasks.withType(Javadoc) { tasks.withType(Javadoc) {
@ -136,23 +138,6 @@ subprojects {
build.dependsOn(checkstyleTest) build.dependsOn(checkstyleTest)
build.dependsOn(javadocJar) build.dependsOn(javadocJar)
shadowJar {
classifier 'dist'
dependencies {
include(dependency('com.sk89q:jchronic:0.2.4a'))
include(dependency('com.thoughtworks.paranamer:paranamer:2.6'))
include(dependency('com.sk89q.lib:jlibnoise:1.0.0'))
include(dependency('net.kyori:text-api:2.0.0'))
include(dependency("net.kyori:text-serializer-gson:2.0.0"))
include(dependency("net.kyori:text-serializer-legacy:2.0.0"))
relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting.text')
}
exclude 'GradleStart**'
exclude '.cache'
exclude 'LICENSE*'
}
artifactoryPublish { artifactoryPublish {
publishConfigs('archives') publishConfigs('archives')
} }
@ -162,3 +147,16 @@ subprojects {
include '**/*.java' include '**/*.java'
} }
} }
configure(['bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) {
shadowJar {
classifier 'dist'
dependencies {
include(project(":worldedit-libs"))
include(project(":worldedit-core"))
}
exclude 'GradleStart**'
exclude '.cache'
exclude 'LICENSE*'
}
}

View File

@ -1,3 +1,8 @@
rootProject.name = 'worldedit' rootProject.name = 'worldedit'
include 'worldedit-core', 'worldedit-bukkit', 'worldedit-forge', 'worldedit-sponge' include 'worldedit-libs'
['bukkit', 'core', 'forge', 'sponge'].forEach {
include "worldedit-libs:$it"
include "worldedit-$it"
}

View File

@ -10,12 +10,11 @@ repositories {
dependencies { dependencies {
compile project(':worldedit-core') compile project(':worldedit-core')
compile project(':worldedit-libs:bukkit')
compile 'com.sk89q:dummypermscompat:1.10' compile 'com.sk89q:dummypermscompat:1.10'
compile 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT' // zzz compile 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT' // zzz
compile 'org.bstats:bstats-bukkit:1.4'
compile "io.papermc:paperlib:1.0.1" compile "io.papermc:paperlib:1.0.1"
compile 'org.slf4j:slf4j-jdk14:1.7.26' compile 'org.slf4j:slf4j-jdk14:1.7.26'
compile 'net.kyori:text-adapter-bukkit:1.0.3'
testCompile 'org.mockito:mockito-core:1.9.0-rc1' testCompile 'org.mockito:mockito-core:1.9.0-rc1'
} }

View File

@ -26,8 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.session.SessionKey;
import com.sk89q.worldedit.util.auth.AuthorizationException; import com.sk89q.worldedit.util.auth.AuthorizationException;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.adapter.bukkit.TextAdapter; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -37,8 +37,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.gamemode.GameModes;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.adapter.bukkit.TextAdapter; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -4,20 +4,15 @@ apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
dependencies { dependencies {
compile project(':worldedit-libs:core')
compile 'de.schlichtherle:truezip:6.8.3' compile 'de.schlichtherle:truezip:6.8.3'
compile 'rhino:js:1.7R2' compile 'rhino:js:1.7R2'
compile 'org.yaml:snakeyaml:1.9' compile 'org.yaml:snakeyaml:1.9'
compile 'com.google.guava:guava:21.0' compile 'com.google.guava:guava:21.0'
compile 'com.sk89q:jchronic:0.2.4a'
compile 'com.google.code.findbugs:jsr305:1.3.9' compile 'com.google.code.findbugs:jsr305:1.3.9'
compile 'com.thoughtworks.paranamer:paranamer:2.6'
compile 'com.google.code.gson:gson:2.8.0' compile 'com.google.code.gson:gson:2.8.0'
compile 'com.sk89q.lib:jlibnoise:1.0.0'
compile 'com.googlecode.json-simple:json-simple:1.1.1' compile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'org.slf4j:slf4j-api:1.7.26' compile 'org.slf4j:slf4j-api:1.7.26'
compile 'net.kyori:text-api:2.0.0'
compile 'net.kyori:text-serializer-gson:2.0.0'
compile 'net.kyori:text-serializer-legacy:2.0.0'
//compile 'net.sf.trove4j:trove4j:3.0.3' //compile 'net.sf.trove4j:trove4j:3.0.3'
testCompile 'org.mockito:mockito-core:1.9.0-rc1' testCompile 'org.mockito:mockito-core:1.9.0-rc1'
} }

View File

@ -62,7 +62,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.storage.ChunkStore; import com.sk89q.worldedit.world.storage.ChunkStore;
import net.kyori.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -65,9 +65,9 @@ import com.sk89q.worldedit.util.formatting.component.Error;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import net.kyori.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -23,7 +23,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.session.SessionOwner;
import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.Identifiable;
import com.sk89q.worldedit.util.auth.Subject; import com.sk89q.worldedit.util.auth.Subject;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import java.io.File; import java.io.File;

View File

@ -34,7 +34,7 @@ import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameMode;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import java.util.UUID; import java.util.UUID;

View File

@ -19,8 +19,8 @@
package com.sk89q.worldedit.util.formatting.component; package com.sk89q.worldedit.util.formatting.component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
/** /**
* Represents a fragment representing a command that is to be typed. * Represents a fragment representing a command that is to be typed.

View File

@ -19,9 +19,9 @@
package com.sk89q.worldedit.util.formatting.component; package com.sk89q.worldedit.util.formatting.component;
import net.kyori.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
public class CommandListBox extends MessageBox { public class CommandListBox extends MessageBox {

View File

@ -28,8 +28,8 @@ import com.sk89q.worldedit.util.command.CommandMapping;
import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Description;
import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.Dispatcher;
import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.command.PrimaryAliasComparator;
import net.kyori.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -19,8 +19,8 @@
package com.sk89q.worldedit.util.formatting.component; package com.sk89q.worldedit.util.formatting.component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
/** /**
* Represents a fragment representing an error. * Represents a fragment representing an error.

View File

@ -19,8 +19,8 @@
package com.sk89q.worldedit.util.formatting.component; package com.sk89q.worldedit.util.formatting.component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
/** /**
* Represents a fragment representing a label. * Represents a fragment representing a label.

View File

@ -21,9 +21,9 @@ package com.sk89q.worldedit.util.formatting.component;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import net.kyori.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
/** /**
* Makes for a box with a border above and below. * Makes for a box with a border above and below.

View File

@ -19,8 +19,8 @@
package com.sk89q.worldedit.util.formatting.component; package com.sk89q.worldedit.util.formatting.component;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
/** /**
* Represents a subtle part of the message. * Represents a subtle part of the message.

View File

@ -34,7 +34,7 @@ import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;

View File

@ -0,0 +1,97 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
subprojects {
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory'
configurations {
create("shade")
}
group = rootProject.group + ".worldedit-libs"
tasks.register("jar", ShadowJar) {
configurations = [project.configurations.shade]
classifier = ""
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)
add("default", sourcesJar)
}
tasks.register("install", Upload) {
configuration = configurations.default
repositories.mavenInstaller {
pom.version = project.version
pom.artifactId = project.name
}
}
artifactoryPublish {
publishConfigs('default')
}
build.dependsOn(jar, sourcesJar)
}
project("core") {
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'
shade 'com.sk89q:jchronic:0.2.4a'
shade 'com.thoughtworks.paranamer:paranamer:2.6'
shade 'com.sk89q.lib:jlibnoise:1.0.0'
}
}
project("bukkit") {
dependencies {
shade 'net.kyori:text-adapter-bukkit:1.0.3'
shade 'org.bstats:bstats-bukkit:1.4'
}
}
project("sponge") {
dependencies {
shade 'net.kyori:text-adapter-spongeapi:1.0.3'
shade 'org.bstats:bstats-sponge:1.4'
}
}
tasks.register("build") {
dependsOn(subprojects.collect { it.tasks.named("build") })
}

View File

@ -17,9 +17,8 @@ repositories {
dependencies { dependencies {
compile project(':worldedit-core') compile project(':worldedit-core')
compile project(':worldedit-libs:sponge')
compile 'org.spongepowered:spongeapi:7.1.0' compile 'org.spongepowered:spongeapi:7.1.0'
compile 'org.bstats:bstats-sponge:1.4'
compile 'net.kyori:text-adapter-spongeapi:1.0.3'
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
} }

View File

@ -26,8 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.session.SessionKey;
import com.sk89q.worldedit.util.auth.AuthorizationException; import com.sk89q.worldedit.util.auth.AuthorizationException;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.adapter.spongeapi.TextAdapter; import com.sk89q.worldedit.util.formatting.text.adapter.spongeapi.TextAdapter;
import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text; import org.spongepowered.api.text.Text;

View File

@ -36,8 +36,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.gamemode.GameModes;
import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.item.ItemTypes;
import net.kyori.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import net.kyori.text.adapter.spongeapi.TextAdapter; import com.sk89q.worldedit.util.formatting.text.adapter.spongeapi.TextAdapter;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.data.type.HandTypes;
import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.entity.living.player.Player;