feat: Paperweight support (#1362)
* Initial work towards paperweight * feat: Port Fawe classes to paperweight - Hide UnsafeUtilities in javadocs - Fix typo in Regenerator - Create fawe tmp directory for fawe regen * Update adapters * chore: Update MiniMessage * Address todos * Fix leftover Tuinity loggers
This commit is contained in:
47
buildSrc/src/main/kotlin/AdapterConfig.kt
Normal file
47
buildSrc/src/main/kotlin/AdapterConfig.kt
Normal file
@@ -0,0 +1,47 @@
|
||||
import io.papermc.paperweight.util.constants.REOBF_CONFIG
|
||||
import org.gradle.api.Named
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.attributes.Attribute
|
||||
import org.gradle.kotlin.dsl.apply
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.gradle.kotlin.dsl.named
|
||||
|
||||
// TODO https://github.com/PaperMC/paperweight/pull/87
|
||||
interface Obfuscation : Named {
|
||||
companion object {
|
||||
val OBFUSCATION_ATTRIBUTE = Attribute.of(
|
||||
"com.fastasyncworldedit.obfuscation",
|
||||
Obfuscation::class.java
|
||||
)
|
||||
const val NONE = "none"
|
||||
const val REOBFUSCATED = "reobfuscated"
|
||||
}
|
||||
}
|
||||
|
||||
// For specific version pinning, see
|
||||
// https://papermc.io/repo/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
|
||||
fun Project.applyPaperweightAdapterConfiguration(
|
||||
paperVersion: String
|
||||
) {
|
||||
applyCommonConfiguration()
|
||||
apply(plugin = "java-library")
|
||||
applyCommonJavaConfiguration(
|
||||
sourcesJar = true,
|
||||
banSlf4j = false,
|
||||
)
|
||||
apply(plugin = "io.papermc.paperweight.userdev")
|
||||
|
||||
dependencies {
|
||||
paperDevBundle(paperVersion)
|
||||
"implementation"(project(":worldedit-bukkit"))
|
||||
}
|
||||
|
||||
tasks.named("assemble") {
|
||||
dependsOn("reobfJar")
|
||||
}
|
||||
|
||||
configurations[REOBF_CONFIG].attributes {
|
||||
attribute(Obfuscation.OBFUSCATION_ATTRIBUTE, objects.named(Obfuscation.REOBFUSCATED))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user