mirror of
https://github.com/architectury/architectury-plugin.git
synced 2026-03-27 19:57:00 -05:00
Don't escape vm args if on 0.10.0.188 or above since Loom does it for us
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.jvm" version "1.5.10"
|
||||
id "org.jetbrains.kotlin.jvm" version "1.6.10"
|
||||
id "java"
|
||||
id "idea"
|
||||
id "eclipse"
|
||||
|
||||
@@ -57,5 +57,7 @@ class LoomInterface010(private val project: Project) : LoomInterface {
|
||||
override fun addVmArg(vmArg: String) {
|
||||
config.vmArgs.add(vmArg)
|
||||
}
|
||||
|
||||
override fun escape(arg: String): String = arg
|
||||
}
|
||||
}
|
||||
@@ -78,5 +78,7 @@ class LoomInterface011(private val project: Project) : LoomInterface {
|
||||
override fun addVmArg(vmArg: String) {
|
||||
config.vmArgs.add(vmArg)
|
||||
}
|
||||
|
||||
override fun escape(arg: String): String = arg
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,7 @@ open class ArchitectPluginExtension(val project: Project) {
|
||||
}
|
||||
|
||||
loom.settingsPostEdit { config ->
|
||||
fun String.escapeSpaces(): String = config.escape(this)
|
||||
val s = config.mainClass
|
||||
config.mainClass = "dev.architectury.transformer.TransformerRuntime"
|
||||
mainClassTransformerFile.writeText(s)
|
||||
@@ -206,13 +207,6 @@ open class ArchitectPluginExtension(val project: Project) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun String.escapeSpaces(): String {
|
||||
if (any(Char::isWhitespace)) {
|
||||
return "\"$this\""
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun fabric(action: Action<Transform> = Action {}) {
|
||||
loader(ModLoader.FABRIC, action)
|
||||
|
||||
@@ -64,5 +64,10 @@ interface LoomInterface {
|
||||
var mainClass: String
|
||||
|
||||
fun addVmArg(vmArg: String)
|
||||
|
||||
fun escape(arg: String): String {
|
||||
if (arg.any(Char::isWhitespace)) return "\"$arg\""
|
||||
return arg
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user