3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-08 04:20:06 +01:00
FastAsyncWorldEdit/buildSrc/src/main/kotlin/AdapterConfig.kt
NotMyFault f0880a27a0
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
2021-10-17 16:32:36 +02:00

48 Zeilen
1.4 KiB
Kotlin

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))
}
}