3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-16 16:10:07 +01:00

Update so many dependencies, merge Forge/Fabric for final jar (#1651)

* Update so many dependencies, merge Forge/Fabric for final

* Clean up contrib docs for Gradle change

* Fix setting compat flags while using toolchain

* Fix deprecation in doc printer

* Restore proper forge JAR name

* Add dist classifier for mod jar

* Properly relocate new bStats

* Fix jar used from fabric

* Fix fabric bom

* Dup the shaded classes for consistency

* Sync Forge/Fabric log4j versions, de-dup

* Downgrade both log4j. This will work

* Update some plugins as well

* Drop the fabric force stuff

* Use duplicate strategy to directly merge jar
Dieser Commit ist enthalten in:
Octavia Togami 2021-01-25 05:14:09 -05:00 committet von MattBDev
Ursprung f3d4621589
Commit 8b1f043dc5
15 geänderte Dateien mit 156 neuen und 54 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,8 @@
Compiling Compiling
========= =========
You can compile FastAsyncWorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 8. You can compile FastAsyncWorldEdit as long as you have some version of Java greater than or equal to 8 installed. Gradle will download JDK 8 specifically if needed,
Newer versions of the JDK may not compile. but it needs some version of Java to bootstrap from.
You only need one version of the JDK installed.
The build process uses Gradle, which you do *not* need to download. FastAsyncWorldEdit is a multi-module project with two active modules: The build process uses Gradle, which you do *not* need to download. FastAsyncWorldEdit is a multi-module project with two active modules:
@ -29,7 +28,7 @@ You will find:
* The core FastAsyncWorldEdit API in **worldedit-core/build/libs** * The core FastAsyncWorldEdit API in **worldedit-core/build/libs**
* FastAsyncWorldEdit for Bukkit in **worldedit-bukkit/build/libs*** * FastAsyncWorldEdit for Bukkit in **worldedit-bukkit/build/libs***
If you want to use FastAsyncWorldEdit, use the `FastAsyncWorldEdit-1.15-#` version. If you want to use FastAsyncWorldEdit, use the `FastAsyncWorldEdit-1.16-#` version.
## Other commands ## Other commands

Datei anzeigen

@ -6,6 +6,21 @@
FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features
**A Minecraft Map Editor... that runs in-game!**
* With selections, schematics, copy and paste, brushes, and scripting!
* Use it in creative, survival in single player or on your server.
* Use it on your Minecraft server to fix grieving and mistakes.
Java Edition required. WorldEdit is compatible with Forge, Fabric, Bukkit, Spigot, Paper, and Sponge.
## Download FastAsyncWorldEdit
### 1.15+
* [Download](https://www.spigotmc.org/resources/fast-async-worldedit.13932/)
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
Looking builds for older versions? Download them [here](https://intellectualsites.github.io/download/).
## Links ## Links
* [Spigot Page](https://www.spigotmc.org/threads/fast-async-worldedit.100104/) * [Spigot Page](https://www.spigotmc.org/threads/fast-async-worldedit.100104/)
@ -15,13 +30,26 @@ FAWE is a fork of WorldEdit that has huge speed and memory improvements and cons
* [Crowdin](https://intellectualsites.crowdin.com/fastasyncworldedit) * [Crowdin](https://intellectualsites.crowdin.com/fastasyncworldedit)
* [JavaDocs](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/javadoc/) * [JavaDocs](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/javadoc/)
## Downloads Edit the Code
### 1.15+ ---------
* [Download](https://www.spigotmc.org/resources/fast-async-worldedit.13932/)
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
Looking builds for older versions? Download them [here](https://intellectualsites.github.io/download/). Want to add new features to WorldEdit or fix bugs yourself? You can get the game running, with WorldEdit, from the code here, without any additional outside steps, by doing the following *four* things:
1. Download WorldEdit's source code and put it somewhere. We recommend you use something called Git if you already know how to use it, but [you can also just download a .zip file](https://github.com/EngineHub/WorldEdit/archive/master.zip). (If you plan on contributing the changes, you will need to figure out Git.)
2. Install any version of Java greater than or equal to 8.
* Note that if you do _not_ install JDK 8 exactly, Gradle will download it for you on first run. However, it is still required to have some form of Java installed for Gradle to start at all.
3. Open terminal / command prompt / bash and navigate to the directory where you put the source code.
4. Run **one** of these following commands:
* Mac OS X / Linux: `./gradlew :worldedit-fabric:runClient`
* Windows - Command Prompt: `gradlew :worldedit-fabric:runClient`
* Windows - PowerShell: `.\gradlew :worldedit-fabric:runClient`
🎉 That's it. 🎉 It takes a long time to actually transform WorldEdit into a mod. If it succeeds, **the Minecraft game will open and you can create a single player world with WorldEdit**.
---
For additional information about compiling WorldEdit, see [COMPILING.md](COMPILING.md).
FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features
## Building ## Building
FAWE uses gradle to build FAWE uses gradle to build

Datei anzeigen

@ -1,5 +1,9 @@
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.repositories import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.the
fun Project.applyCommonConfiguration() { fun Project.applyCommonConfiguration() {
group = rootProject.group group = rootProject.group
@ -50,4 +54,29 @@ fun Project.applyCommonConfiguration() {
cacheChangingModulesFor(5, "MINUTES") cacheChangingModulesFor(5, "MINUTES")
} }
} }
plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
dependencies {
constraints {
for (conf in configurations.names) {
add(conf, "com.google.guava:guava") {
version { strictly(Versions.GUAVA) }
because("Mojang provides Guava")
}
add(conf, "com.google.code.gson:gson") {
version { strictly(Versions.GSON) }
because("Mojang provides Gson")
}
add(conf, "it.unimi.dsi:fastutil") {
version { strictly(Versions.FAST_UTIL) }
because("Mojang provides FastUtil")
}
}
}
}
} }

Datei anzeigen

@ -116,6 +116,7 @@ fun Project.applyShadowConfiguration() {
include(project(":worldedit-libs:core")) include(project(":worldedit-libs:core"))
include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}")) include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}"))
include(project(":worldedit-core")) include(project(":worldedit-core"))
exclude("com.google.code.findbugs:jsr305")
} }
archiveFileName.set("FastAsyncWorldEdit-${project.version}.jar") archiveFileName.set("FastAsyncWorldEdit-${project.version}.jar")
exclude("GradleStart**") exclude("GradleStart**")

Datei anzeigen

@ -1,6 +1,19 @@
/*
import org.gradle.api.Project import org.gradle.api.Project
object Versions {
const val TEXT = "3.0.4"
const val TEXT_EXTRAS = "3.0.6"
const val PISTON = "0.5.6"
const val AUTO_VALUE = "1.7.4"
const val JUNIT = "5.7.0"
const val MOCKITO = "3.7.7"
const val SLF4J = "1.7.30"
const val LOGBACK = "1.2.3"
const val FAST_UTIL = "8.2.1"
const val GUAVA = "21.0"
const val GSON = "2.8.0"
}
// Properties that need a project reference to resolve: // Properties that need a project reference to resolve:
class ProjectVersions(project: Project) { class ProjectVersions(project: Project) {
val loom = project.rootProject.property("loom.version") val loom = project.rootProject.property("loom.version")
@ -9,5 +22,3 @@ class ProjectVersions(project: Project) {
val Project.versions val Project.versions
get() = ProjectVersions(this) get() = ProjectVersions(this)
*/

Datei anzeigen

@ -8,5 +8,5 @@ org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.vfs.watch=true org.gradle.vfs.watch=true
loom.version=0.2.6-20200124.104118-60 loom.version=0.5.43
mixin.version=0.8+build.17 mixin.version=0.8.1+build.21

Datei anzeigen

@ -6,6 +6,7 @@ listOf("bukkit", "core").forEach {
include("worldedit-libs:$it") include("worldedit-libs:$it")
include("worldedit-$it") include("worldedit-$it")
} }
include("worldedit-mod")
include("worldedit-libs:core:ap") include("worldedit-libs:core:ap")
dependencyResolutionManagement { dependencyResolutionManagement {

Datei anzeigen

@ -9,11 +9,12 @@ applyShadowConfiguration()
dependencies { dependencies {
"api"(project(":worldedit-core")) "api"(project(":worldedit-core"))
"implementation"("org.apache.logging.log4j:log4j-core:2.8.1") "implementation"(platform("org.apache.logging.log4j:log4j-bom:2.14.0"))
"implementation"("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1") "implementation"("org.apache.logging.log4j:log4j-core")
"implementation"("org.apache.logging.log4j:log4j-slf4j-impl")
"implementation"("commons-cli:commons-cli:1.4") "implementation"("commons-cli:commons-cli:1.4")
"implementation"("com.google.guava:guava:21.0") "implementation"("com.google.guava:guava")
"implementation"("com.google.code.gson:gson:2.8.6") "implementation"("com.google.code.gson:gson")
} }
tasks.named<Jar>("jar") { tasks.named<Jar>("jar") {

Datei anzeigen

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
kotlin("jvm") version "1.4.0" kotlin("jvm") version "1.4.21"
application application
} }
@ -11,7 +11,7 @@ tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "1.8"
} }
application.mainClassName = "com.sk89q.worldedit.internal.util.DocumentationPrinter" application.mainClass.set("com.sk89q.worldedit.internal.util.DocumentationPrinter")
tasks.named<JavaExec>("run") { tasks.named<JavaExec>("run") {
workingDir = rootProject.projectDir workingDir = rootProject.projectDir
} }
@ -21,5 +21,5 @@ dependencies {
"implementation"(project(":worldedit-core")) "implementation"(project(":worldedit-core"))
"implementation"(kotlin("stdlib-jdk8")) "implementation"(kotlin("stdlib-jdk8"))
"implementation"(kotlin("reflect")) "implementation"(kotlin("reflect"))
"implementation"("com.google.guava:guava:21.0") "implementation"("com.google.guava:guava")
} }

Datei anzeigen

@ -149,7 +149,7 @@ class DocumentationPrinter private constructor() {
} }
private fun writeHeader() { private fun writeHeader() {
cmdOutput.appendln(""" cmdOutput.appendLine("""
======== ========
Commands Commands
======== ========
@ -166,7 +166,7 @@ Commands
You can access a command listing in-game via the ``//help`` command. You can access a command listing in-game via the ``//help`` command.
""".trim()) """.trim())
permsOutput.appendln(""" permsOutput.appendLine("""
=========== ===========
Permissions Permissions
=========== ===========
@ -184,11 +184,11 @@ See the :doc:`commands` page for an explanation of some of these commands.
:header: Command, Permission :header: Command, Permission
:widths: 15, 25 :widths: 15, 25
""".trim()) """.trim())
permsOutput.appendln() permsOutput.appendLine()
} }
private fun writeFooter() { private fun writeFooter() {
permsOutput.appendln() permsOutput.appendLine()
permsOutput.append(""" permsOutput.append("""
Other Permissions Other Permissions
================== ==================
@ -254,10 +254,10 @@ Other Permissions
val name = prefix + command.name val name = prefix + command.name
val entries = commandTableEntries(command, parents) val entries = commandTableEntries(command, parents)
cmdOutput.appendln(".. raw:: html") cmdOutput.appendLine(".. raw:: html")
cmdOutput.appendln() cmdOutput.appendLine()
cmdOutput.appendln(""" <span id="command-${linkSafe(name)}"></span>""") cmdOutput.appendLine(""" <span id="command-${linkSafe(name)}"></span>""")
cmdOutput.appendln() cmdOutput.appendLine()
cmdOutput.append(".. topic:: ``$name``") cmdOutput.append(".. topic:: ``$name``")
if (!command.aliases.isEmpty()) { if (!command.aliases.isEmpty()) {
command.aliases.joinTo(cmdOutput, ", ", command.aliases.joinTo(cmdOutput, ", ",
@ -265,19 +265,19 @@ Other Permissions
postfix = ")", postfix = ")",
transform = { "``$prefix$it``" }) transform = { "``$prefix$it``" })
} }
cmdOutput.appendln() cmdOutput.appendLine()
cmdOutput.appendln(" :class: command-topic").appendln() cmdOutput.appendLine(" :class: command-topic").appendLine()
CommandUtil.deprecationWarning(command).ifPresent { warning -> CommandUtil.deprecationWarning(command).ifPresent { warning ->
cmdOutput.appendln(""" cmdOutput.appendLine("""
| .. WARNING:: | .. WARNING::
| ${reduceToRst(warning).makeRstSafe("\n\n")} | ${reduceToRst(warning).makeRstSafe("\n\n")}
""".trimMargin()) """.trimMargin())
} }
cmdOutput.appendln(""" cmdOutput.appendLine("""
| .. csv-table:: | .. csv-table::
| :widths: 8, 15 | :widths: 8, 15
""".trimMargin()) """.trimMargin())
cmdOutput.appendln() cmdOutput.appendLine()
for ((k, v) in entries) { for ((k, v) in entries) {
val rstSafe = v.makeRstSafe("\n") val rstSafe = v.makeRstSafe("\n")
cmdOutput.append(" ".repeat(2)) cmdOutput.append(" ".repeat(2))
@ -285,9 +285,9 @@ Other Permissions
.append(",") .append(",")
.append('"') .append('"')
.append(rstSafe) .append(rstSafe)
.append('"').appendln() .append('"').appendLine()
} }
cmdOutput.appendln() cmdOutput.appendLine()
} }
private fun String.makeRstSafe(lineJoiner: String) = trim() private fun String.makeRstSafe(lineJoiner: String) = trim()

Datei anzeigen

@ -18,8 +18,11 @@ configurations.all {
} }
dependencies { dependencies {
"compile"(project(":worldedit-core")) "api"(project(":worldedit-core"))
"compile"("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1") "implementation"(enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.8.1") {
because("Mojang provides Log4J, we bump to match Forge")
})
"implementation"("org.apache.logging.log4j:log4j-slf4j-impl")
"minecraft"("com.mojang:minecraft:$minecraftVersion") "minecraft"("com.mojang:minecraft:$minecraftVersion")
"mappings"("net.fabricmc:yarn:$yarnMappings") "mappings"("net.fabricmc:yarn:$yarnMappings")
@ -73,7 +76,7 @@ tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("dist-dev") archiveClassifier.set("dist-dev")
dependencies { dependencies {
relocate("org.slf4j", "com.sk89q.worldedit.slf4j") relocate("org.slf4j", "com.sk89q.worldedit.slf4j")
relocate("org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge") relocate("org.apache.logging.slf4j", "com.sk89q.worldedit.l4j")
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4") relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
include(dependency("org.slf4j:slf4j-api")) include(dependency("org.slf4j:slf4j-api"))

Datei anzeigen

@ -27,7 +27,10 @@ configurations.all {
dependencies { dependencies {
"api"(project(":worldedit-core")) "api"(project(":worldedit-core"))
"implementation"("org.apache.logging.log4j:log4j-slf4j-impl:2.11.2") "implementation"(enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.8.1") {
because("Forge provides Log4J (Mojang provides a lower version, but Forge bumps)")
})
"implementation"("org.apache.logging.log4j:log4j-slf4j-impl")
"minecraft"("net.minecraftforge:forge:$minecraftVersion-$forgeVersion") "minecraft"("net.minecraftforge:forge:$minecraftVersion-$forgeVersion")
} }
@ -93,7 +96,7 @@ addJarManifest(includeClasspath = false)
tasks.named<ShadowJar>("shadowJar") { tasks.named<ShadowJar>("shadowJar") {
dependencies { dependencies {
relocate("org.slf4j", "com.sk89q.worldedit.slf4j") relocate("org.slf4j", "com.sk89q.worldedit.slf4j")
relocate("org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge") relocate("org.apache.logging.slf4j", "com.sk89q.worldedit.l4j")
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4") relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
include(dependency("org.slf4j:slf4j-api")) include(dependency("org.slf4j:slf4j-api"))

2
worldedit-mod/README.md Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
This folder is for the merged output of Fabric and Forge jars. This allows us to distribute
both variants of the mod in a single file to avoid end-user confusion.

Datei anzeigen

@ -0,0 +1,24 @@
import net.fabricmc.loom.task.RemapJarTask
plugins {
base
}
applyCommonConfiguration()
tasks.register<Jar>("jar") {
val remapFabric = project(":worldedit-fabric").tasks.named<RemapJarTask>("remapShadowJar")
dependsOn(
remapFabric,
project(":worldedit-forge").tasks.named("reobfShadowJar")
)
from(zipTree({remapFabric.get().archiveFile}))
from(zipTree({project(":worldedit-forge").tasks.getByName("shadowJar").outputs.files.singleFile}))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("dist")
}
tasks.named("assemble") {
dependsOn("jar")
}

Datei anzeigen

@ -1,28 +1,28 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins { plugins {
id("org.spongepowered.plugin") id("org.spongepowered.gradle.plugin")
} }
applyPlatformAndCoreConfiguration() applyPlatformAndCoreConfiguration()
applyShadowConfiguration() applyShadowConfiguration()
// I can't believe sponge sets this in a base plugin with no opt-out
convention.getPlugin(JavaPluginConvention::class.java).apply {
setSourceCompatibility(null)
setTargetCompatibility(null)
}
repositories { repositories {
maven { url = uri("https://repo.codemc.org/repository/maven-public") } maven { url = uri("https://repo.codemc.org/repository/maven-public") }
} }
dependencies { dependencies {
compile(project(":worldedit-core")) api(project(":worldedit-core"))
compile(project(":worldedit-libs:sponge")) api(project(":worldedit-libs:sponge"))
compile("org.spongepowered:spongeapi:7.1.0") api("org.spongepowered:spongeapi:7.1.0")
compile("org.bstats:bstats-sponge:1.5") api("org.bstats:bstats-sponge:1.7")
testCompile("org.mockito:mockito-core:1.9.0-rc1") testImplementation("org.mockito:mockito-core:1.9.0-rc1")
}
sponge {
plugin {
id = "worldedit"
}
} }
<<<<<<< HEAD <<<<<<< HEAD