mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 22:10:18 +00:00
fix remapping not working
This commit is contained in:
1 parent
91ec6b773d
commit
350328f99c
1 file changed
+73
-71
+73
-71
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.function.Consumer
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||||
@@ -80,29 +82,19 @@ NMS_BINDINGS.each {
|
|||||||
def m2s = m2.getAbsolutePath();
|
def m2s = m2.getAbsolutePath();
|
||||||
|
|
||||||
// ======================== Building Mapped Jars =============================
|
// ======================== Building Mapped Jars =============================
|
||||||
Runnable downloadBuildtools = () -> {
|
Runnable executeBuildTools = () -> {
|
||||||
|
//Download
|
||||||
if (!buildToolsJar.exists()) {
|
if (!buildToolsJar.exists()) {
|
||||||
download.run {
|
download.run {
|
||||||
src 'https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar'
|
src 'https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar'
|
||||||
dest buildToolsJar
|
dest buildToolsJar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Runnable downloadSpecialSource = () -> {
|
//Execute
|
||||||
if (!specialSourceJar.exists()) {
|
|
||||||
download.run {
|
|
||||||
src 'https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/' + specialSourceVersion + '/SpecialSource-'+specialSourceVersion+'-shaded.jar'
|
|
||||||
dest specialSourceJar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Runnable executeBuildTools = () -> {
|
|
||||||
if (!buildToolsHint.exists()) {
|
if (!buildToolsHint.exists()) {
|
||||||
downloadBuildtools.run()
|
|
||||||
buildToolsFolder.mkdirs()
|
buildToolsFolder.mkdirs()
|
||||||
javaexec {
|
project.javaexec {
|
||||||
classpath = files(buildToolsJar)
|
classpath = files(buildToolsJar)
|
||||||
workingDir = buildToolsFolder
|
workingDir = buildToolsFolder
|
||||||
args = [
|
args = [
|
||||||
@@ -116,69 +108,76 @@ NMS_BINDINGS.each {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Consumer<File> specialSourceRemap = outputFile -> {
|
||||||
|
//Download
|
||||||
|
if (!specialSourceJar.exists()) {
|
||||||
|
download.run {
|
||||||
|
src 'https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/' + specialSourceVersion + '/SpecialSource-'+specialSourceVersion+'-shaded.jar'
|
||||||
|
dest specialSourceJar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
specialSourceFolder.mkdirs();
|
||||||
|
|
||||||
|
//Copy
|
||||||
|
project.copy {
|
||||||
|
from outputFile
|
||||||
|
into specialSourceFolder
|
||||||
|
}
|
||||||
|
|
||||||
|
//obfuscate
|
||||||
|
project.javaexec {
|
||||||
|
workingDir = specialSourceFolder
|
||||||
|
classpath = files(specialSourceJar,
|
||||||
|
new File(m2s + "/org/spigotmc/spigot/" + value + "/spigot-" + value + "-remapped-mojang.jar"))
|
||||||
|
mainClass = "net.md_5.specialsource.SpecialSource"
|
||||||
|
args = [
|
||||||
|
"--live",
|
||||||
|
"-i",
|
||||||
|
ssiJar.getName(),
|
||||||
|
"-o",
|
||||||
|
ssobfJar.getName(),
|
||||||
|
"-m",
|
||||||
|
m2s + "/org/spigotmc/minecraft-server/" + value + "/minecraft-server-" + value + "-maps-mojang.txt",
|
||||||
|
"--reverse",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//remap
|
||||||
|
project.javaexec {
|
||||||
|
workingDir = specialSourceFolder
|
||||||
|
classpath = files(specialSourceJar,
|
||||||
|
new File(m2s + "/org/spigotmc/spigot/" + value + "/spigot-" + value + "-remapped-obf.jar"))
|
||||||
|
mainClass = "net.md_5.specialsource.SpecialSource"
|
||||||
|
args = [
|
||||||
|
"--live",
|
||||||
|
"-i",
|
||||||
|
ssobfJar.getName(),
|
||||||
|
"-o",
|
||||||
|
ssJar.getName(),
|
||||||
|
"-m",
|
||||||
|
m2s + "/org/spigotmc/minecraft-server/" + value + "/minecraft-server-" + value + "-maps-spigot.csrg"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
//copy
|
||||||
|
project.copy {
|
||||||
|
from ssJar
|
||||||
|
into outputFile.getParentFile()
|
||||||
|
rename {
|
||||||
|
outputFile.getName()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register("executeBuildTools") {
|
tasks.register("executeBuildTools") {
|
||||||
doFirst {
|
doFirst {
|
||||||
executeBuildTools.run()
|
executeBuildTools.run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("copyBuildToSpecialSource", Copy) {
|
|
||||||
doFirst {
|
|
||||||
downloadSpecialSource.run()
|
|
||||||
specialSourceFolder.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
group "remapping"
|
|
||||||
from outputJar
|
|
||||||
into specialSourceFolder
|
|
||||||
dependsOn(jar)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("specialSourceRemapObfuscate", JavaExec) {
|
|
||||||
group "remapping"
|
|
||||||
dependsOn(copyBuildToSpecialSource)
|
|
||||||
workingDir = specialSourceFolder
|
|
||||||
classpath = files(specialSourceJar,
|
|
||||||
new File(m2s + "/org/spigotmc/spigot/" + value + "/spigot-" + value + "-remapped-mojang.jar"))
|
|
||||||
mainClass = "net.md_5.specialsource.SpecialSource"
|
|
||||||
args = [
|
|
||||||
"--live",
|
|
||||||
"-i",
|
|
||||||
ssiJar.getName(),
|
|
||||||
"-o",
|
|
||||||
ssobfJar.getName(),
|
|
||||||
"-m",
|
|
||||||
m2s + "/org/spigotmc/minecraft-server/" + value + "/minecraft-server-" + value + "-maps-mojang.txt",
|
|
||||||
"--reverse",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("specialSourceRemap", JavaExec) {
|
tasks.register("specialSourceRemap", JavaExec) {
|
||||||
group "remapping"
|
doFirst {
|
||||||
dependsOn(specialSourceRemapObfuscate)
|
specialSourceRemap.accept(outputJar)
|
||||||
workingDir = specialSourceFolder
|
|
||||||
classpath = files(specialSourceJar,
|
|
||||||
new File(m2s + "/org/spigotmc/spigot/" + value + "/spigot-" + value + "-remapped-obf.jar"))
|
|
||||||
mainClass = "net.md_5.specialsource.SpecialSource"
|
|
||||||
args = [
|
|
||||||
"--live",
|
|
||||||
"-i",
|
|
||||||
ssobfJar.getName(),
|
|
||||||
"-o",
|
|
||||||
ssJar.getName(),
|
|
||||||
"-m",
|
|
||||||
m2s + "/org/spigotmc/minecraft-server/" + value + "/minecraft-server-" + value + "-maps-spigot.csrg"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("copySpecialSourceToBuild", Copy) {
|
|
||||||
group "remapping"
|
|
||||||
from ssJar
|
|
||||||
into outputJar.getParentFile()
|
|
||||||
rename {
|
|
||||||
outputJar.getName()
|
|
||||||
}
|
}
|
||||||
dependsOn(specialSourceRemap)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
@@ -187,10 +186,13 @@ NMS_BINDINGS.each {
|
|||||||
relocate('io.papermc.lib', 'com.volmit.iris.util.paper')
|
relocate('io.papermc.lib', 'com.volmit.iris.util.paper')
|
||||||
relocate('net.kyori', 'com.volmit.iris.util.kyori')
|
relocate('net.kyori', 'com.volmit.iris.util.kyori')
|
||||||
archiveFileName.set("Iris-${project.name}.jar")
|
archiveFileName.set("Iris-${project.name}.jar")
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
specialSourceRemap.accept(archiveFile.get().asFile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.build.dependsOn(copySpecialSourceToBuild)
|
tasks.build.dependsOn(specialSourceRemap)
|
||||||
tasks.shadowJar.dependsOn(build)
|
|
||||||
executeBuildTools.run()
|
executeBuildTools.run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user