mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-19 15:09:18 +00:00
whoops forgot to disable craftbukkit relocations on <=1.20.4
This commit is contained in:
@@ -63,21 +63,25 @@ class NMSBinding : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val (major, minor) = config.version.parseVersion()
|
||||||
|
if (major <= 20 && minor <= 4) return@with
|
||||||
tasks.register("convert", ConversionTask::class.java, type)
|
tasks.register("convert", ConversionTask::class.java, type)
|
||||||
val tasks = gradle.startParameter.taskNames
|
tasks.named("compileJava") { it.dependsOn("convert") }
|
||||||
tasks.addFirst("$path:convert")
|
rootProject.tasks.named("prepareKotlinBuildScriptModel") { it.dependsOn("$path:convert") }
|
||||||
gradle.startParameter.setTaskNames(tasks)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
open class ConversionTask @Inject constructor(type: Type, ) : DefaultTask() {
|
open class ConversionTask @Inject constructor(type: Type) : DefaultTask() {
|
||||||
private val pattern: Regex
|
private val pattern: Regex
|
||||||
private val replacement: String
|
private val replacement: String
|
||||||
|
|
||||||
init {
|
init {
|
||||||
group = "nms"
|
group = "nms"
|
||||||
inputs.property("type", type)
|
inputs.property("type", type)
|
||||||
outputs.file("dummy")
|
val java = project.extensions.findByType(JavaPluginExtension::class.java) ?: throw GradleException("Java plugin not found")
|
||||||
|
val source = java.sourceSets.findByName("main")?.allJava ?: throw GradleException("No main source set found")
|
||||||
|
outputs.files(source)
|
||||||
|
|
||||||
if (type == Type.USER_DEV) {
|
if (type == Type.USER_DEV) {
|
||||||
pattern = "org\\.bukkit\\.craftbukkit\\.${project.name}".toRegex()
|
pattern = "org\\.bukkit\\.craftbukkit\\.${project.name}".toRegex()
|
||||||
replacement = "org.bukkit.craftbukkit"
|
replacement = "org.bukkit.craftbukkit"
|
||||||
@@ -89,11 +93,9 @@ class NMSBinding : Plugin<Project> {
|
|||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun process() {
|
fun process() {
|
||||||
val java = project.extensions.findByType(JavaPluginExtension::class.java) ?: throw GradleException("Java plugin not found")
|
|
||||||
val source = java.sourceSets.findByName("main")?.allJava ?: throw GradleException("No main source set found")
|
|
||||||
val dispatcher = Dispatchers.IO.limitedParallelism(16)
|
val dispatcher = Dispatchers.IO.limitedParallelism(16)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
for (file in source) {
|
for (file in outputs.files) {
|
||||||
if (file.extension !in listOf("java"))
|
if (file.extension !in listOf("java"))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -153,7 +155,9 @@ class NMSBinding : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val NEW_LINE = System.lineSeparator()
|
private val NEW_LINE = System.lineSeparator()
|
||||||
|
private fun String.parseVersion() = substringBefore('-').split(".").let {
|
||||||
|
it[1].toInt() to it[2].toInt()
|
||||||
|
}
|
||||||
|
|
||||||
class Config(
|
class Config(
|
||||||
var jvm: Int = 21,
|
var jvm: Int = 21,
|
||||||
|
|||||||
Reference in New Issue
Block a user