Handle loom 0.9 when doing reflection in the build.gradle.kts file
This commit is contained in:
parent
dbe6390fb4
commit
b275be425c
|
@ -62,13 +62,15 @@ subprojects {
|
||||||
}
|
}
|
||||||
silentMojangMappingsLicense()
|
silentMojangMappingsLicense()
|
||||||
val refmap = "snowygui-${project.name}-refmap.json"
|
val refmap = "snowygui-${project.name}-refmap.json"
|
||||||
// The following is used to make this buildscript compatible with architectury-loom 0.7.3, 0.9.X, 0.10.X and higher versions
|
// The following is used to make this buildscript compatible with architectury-loom 0.7.3, 0.9.X, 0.10.X and higher versions
|
||||||
with(javaClass) {
|
with(javaClass) {
|
||||||
if (LoomGradlePlugin.LOOM_VERSION.run {
|
val loomMajorRelease = LoomGradlePlugin.LOOM_VERSION.run {
|
||||||
val numberPos = indexOf('.') + 1
|
val numberPos = indexOf('.') + 1
|
||||||
substring(numberPos, indexOf('.', numberPos))
|
substring(numberPos, indexOf('.', numberPos))
|
||||||
}.toShort() < 10) {
|
}.toShort()
|
||||||
getField("refmapName").set(this@configure, refmap)
|
if (loomMajorRelease < 10) {
|
||||||
|
if (loomMajorRelease < 9) getField("refmapName").set(this@configure, refmap)
|
||||||
|
else getMethod("setRefmapName", String::class.java).invoke(this@configure, refmap)
|
||||||
getMethod("mixinConfig", Array<String>::class.java).invoke(this@configure, arrayOf("snowygui-${project.name}.mixins.json"))
|
getMethod("mixinConfig", Array<String>::class.java).invoke(this@configure, arrayOf("snowygui-${project.name}.mixins.json"))
|
||||||
} else {
|
} else {
|
||||||
getDeclaredMethod("getMixin").invoke(this@configure).run {
|
getDeclaredMethod("getMixin").invoke(this@configure).run {
|
||||||
|
|
Loading…
Reference in New Issue