3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-03 01:50:07 +01:00
FastAsyncWorldEdit/worldedit-bukkit/build.gradle.kts
Jordan d6e3c331d4
Make 1.18 to be effectively in a usable state (#1452)
* Update swathes of easy-to-update-sort-of-code.
 - Untested
 - Should compile but NMF broken something
 - Several todos:
  - biome history//better support (move to biome sections in core)
  - regen (haha lol no thanks, someone else can do that)
  - probably actually do the palette stuff that probably won't work in PaperweightPlatformAdapter

* ci: Provide basic Jenkinsfile for ghprb pipeline

* build: Update paperweight

* upstream: Update Upstream

de6fa17 Add getBrush helper for use with instanceof pattern matching (1926)

* FAWE will now load on startup

* it....works?

* Begin to allow biome edits (and fix biomes reverting to plains upon editing blocks)

* Add new blocks/block properties

* Only create biome palette if supplies is null

* Fix biome operations

* Finally get removing BlockID done (major version change allows it)

* refactor!: Drop PlotSquared v4

Fawe 2.0.0 and newer requires Java 17, PlotSquared v4 supports 1.13 and 1.14, Fawe wont work on these versions nevertheless and refuses to load due Java version incompatiblities with older versions. Newer versions can use PlotSquared v6.

* docs: Update readme

* Added and removed some comments

* Added and removed some comments

* refactor: Rename worldedit configuration

* build: Re-add 1.17 module

This the a very nasty commit

* chore: Implement missing methods

* build: Update paperweight

* upstream: Update upstream

6df194e Remove finalize, use a Cleaner instead (1943)
9843a4f Fix snapshots in 1.18 (1959)

* ci: Escape workflows

* build: Update paperweight to 1.18.1

* build: Update Paster

* Fix compilation

* Bump to 1.18.1

* Do both 1.18 and 1.18.1

Co-authored-by: Alex <mc.cache@web.de>

* Fix single-block lookups

* Reserve ordinals 0 through 3 for air/"reserved"

* Create block palette data with values

* Fix classpath for testing for starlight

* Correctly use block rather than sky light layer [not used in paper]

Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
2021-12-20 21:12:04 +00:00

203 Zeilen
7.2 KiB
Plaintext

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.papermc.paperweight.userdev.attribute.Obfuscation
plugins {
`java-library`
}
project.description = "Bukkit"
applyPlatformAndCoreConfiguration()
applyShadowConfiguration()
repositories {
maven {
name = "SpigotMC"
url = uri("https://hub.spigotmc.org/nexus/content/groups/public")
}
maven {
name = "PaperMC"
url = uri("https://papermc.io/repo/repository/maven-public/")
}
maven {
name = "EngineHub"
url = uri("https://maven.enginehub.org/repo/")
}
maven {
name = "JitPack"
url = uri("https://jitpack.io")
}
maven {
name = "ProtocolLib"
url = uri("https://repo.dmulloy2.net/nexus/repository/public/")
}
maven {
name = "OSS Sonatype Snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
name = "OSS Sonatype Releases"
url = uri("https://oss.sonatype.org/content/repositories/releases/")
}
flatDir { dir(File("src/main/resources")) }
}
val localImplementation = configurations.create("localImplementation") {
description = "Dependencies used locally, but provided by the runtime Bukkit implementation"
isCanBeConsumed = false
isCanBeResolved = false
}
val adapters = configurations.create("adapters") {
description = "Adapters to include in the JAR"
isCanBeConsumed = false
isCanBeResolved = true
shouldResolveConsistentlyWith(configurations["runtimeClasspath"])
attributes {
attribute(Obfuscation.OBFUSCATION_ATTRIBUTE, objects.named(Obfuscation.OBFUSCATED))
}
}
dependencies {
// Modules
api(projects.worldeditCore)
api(projects.worldeditLibs.bukkit)
project.project(":worldedit-bukkit:adapters").subprojects.forEach {
"adapters"(project(it.path))
}
// Minecraft expectations
implementation(libs.fastutil)
// Platform expectations
compileOnly(libs.paper) {
exclude("junit", "junit")
exclude(group = "org.slf4j", module = "slf4j-api")
}
// Logging
localImplementation(libs.log4j)
localImplementation(libs.log4jBom) {
because("Spigot provides Log4J (sort of, not in API, implicitly part of server)")
}
// Plugins
compileOnly(libs.vault) { isTransitive = false }
compileOnly(libs.dummypermscompat) {
exclude("com.github.MilkBowl", "VaultAPI")
}
compileOnly(libs.worldguard) {
exclude("com.sk89q.worldedit", "worldedit-bukkit")
exclude("com.sk89q.worldedit", "worldedit-core")
exclude("com.sk89q.worldedit.worldedit-libs", "bukkit")
exclude("com.sk89q.worldedit.worldedit-libs", "core")
}
compileOnly(libs.mapmanager) { isTransitive = false }
compileOnly(libs.griefprevention) { isTransitive = false }
compileOnly(libs.griefdefender) { isTransitive = false }
compileOnly(libs.mcore) { isTransitive = false }
compileOnly(libs.residence) { isTransitive = false }
compileOnly(libs.towny) { isTransitive = false }
compileOnly(libs.protocollib) { isTransitive = false }
compileOnly(libs.plotsquaredV6Bukkit) { isTransitive = false }
compileOnly(libs.plotsquaredV6Core) { isTransitive = false }
// Third party
compileOnly(libs.flowmath) {
because("This dependency is needed by GriefDefender but not exposed transitively.")
isTransitive = false
}
implementation(libs.paperlib)
implementation(libs.bstatsBukkit) { isTransitive = false }
implementation(libs.bstatsBase) { isTransitive = false }
implementation(libs.serverlib)
api(libs.paster) { isTransitive = false }
api(libs.lz4Java) { isTransitive = false }
api(libs.sparsebitset) { isTransitive = false }
api(libs.parallelgzip) { isTransitive = false }
compileOnly(libs.adventure)
compileOnlyApi(libs.checkerqual)
// Tests
testImplementation(libs.mockito)
testImplementation(libs.adventure)
testImplementation(libs.checkerqual)
testImplementation(libs.paper) { isTransitive = true }
}
tasks.named<Copy>("processResources") {
val internalVersion = project.ext["internalVersion"]
inputs.property("internalVersion", internalVersion)
filesMatching("plugin.yml") {
expand("internalVersion" to internalVersion)
}
}
tasks.named<Jar>("jar") {
manifest {
attributes("Class-Path" to CLASSPATH,
"WorldEdit-Version" to project.version)
}
}
addJarManifest(WorldEditKind.Plugin, includeClasspath = true)
tasks.named<ShadowJar>("shadowJar") {
dependsOn(project.project(":worldedit-bukkit:adapters").subprojects.map { it.tasks.named("assemble") })
from(Callable {
adapters.resolve()
.map { f ->
zipTree(f).matching {
exclude("META-INF/")
}
}
})
archiveFileName.set("${rootProject.name}-Bukkit-${project.version}.${archiveExtension.getOrElse("jar")}")
dependencies {
// In tandem with not bundling log4j, we shouldn't relocate base package here.
// relocate("org.apache.logging", "com.sk89q.worldedit.log4j")
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
include(dependency(":worldedit-core"))
include(dependency(":worldedit-libs:bukkit"))
// Purposefully not included, we assume (even though no API exposes it) that Log4J will be present at runtime
// If it turns out not to be true for Spigot/Paper, our only two official platforms, this can be uncommented.
// include(dependency("org.apache.logging.log4j:log4j-api"))
include(dependency("org.antlr:antlr4-runtime"))
// ZSTD does not work if relocated. https://github.com/luben/zstd-jni/issues/189 Use not latest as it can be difficult
// to obtain latest ZSTD lib
include(dependency("com.github.luben:zstd-jni:1.4.8-1"))
relocate("org.bstats", "com.sk89q.worldedit.bstats") {
include(dependency("org.bstats:"))
}
relocate("io.papermc.lib", "com.sk89q.worldedit.bukkit.paperlib") {
include(dependency("io.papermc:paperlib"))
}
relocate("it.unimi.dsi.fastutil", "com.sk89q.worldedit.bukkit.fastutil") {
include(dependency("it.unimi.dsi:fastutil"))
}
relocate("org.incendo.serverlib", "com.fastasyncworldedit.serverlib") {
include(dependency("dev.notmyfault.serverlib:ServerLib:2.3.1"))
}
relocate("com.intellectualsites.paster", "com.fastasyncworldedit.paster") {
include(dependency("com.intellectualsites.paster:Paster:1.1.1"))
}
relocate("org.lz4", "com.fastasyncworldedit.core.lz4") {
include(dependency("org.lz4:lz4-java:1.8.0"))
}
relocate("net.kyori", "com.fastasyncworldedit.core.adventure") {
include(dependency("net.kyori:adventure-nbt:4.9.3"))
}
relocate("com.zaxxer", "com.fastasyncworldedit.core.math") {
include(dependency("com.zaxxer:SparseBitSet:1.2"))
}
relocate("org.anarres", "com.fastasyncworldedit.core.internal.io") {
include(dependency("org.anarres:parallelgzip:1.0.5"))
}
}
}
tasks.named("assemble").configure {
dependsOn("shadowJar")
}