mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Remapped packaging
This commit is contained in:
parent
26396bbe1a
commit
7cd752ceb7
191
build.gradle
191
build.gradle
@ -26,58 +26,22 @@ group 'com.volmit.iris'
|
|||||||
version '1.9.6-1.18.X'
|
version '1.9.6-1.18.X'
|
||||||
def nmsVersion = "1.18.1"
|
def nmsVersion = "1.18.1"
|
||||||
def apiVersion = '1.18'
|
def apiVersion = '1.18'
|
||||||
|
def spigotJarVersion = '1.18.1-R0.1-SNAPSHOT'
|
||||||
def name = getRootProject().getName() // Defined in settings.gradle
|
def name = getRootProject().getName() // Defined in settings.gradle
|
||||||
def main = 'com.volmit.iris.Iris'
|
def main = 'com.volmit.iris.Iris'
|
||||||
|
|
||||||
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
|
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
|
||||||
// ======================== WINDOWS =============================
|
// ======================== WINDOWS =============================
|
||||||
registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins', name)
|
registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins')
|
||||||
registerCustomOutputTask('Psycho', 'D://Dan/MinecraftDevelopment/server/plugins', name)
|
registerCustomOutputTask('Psycho', 'D://Dan/MinecraftDevelopment/server/plugins')
|
||||||
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins', name)
|
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins')
|
||||||
registerCustomOutputTask('Coco', 'C://Users/sjoer/Desktop/MCSM/plugins', name)
|
registerCustomOutputTask('Coco', 'C://Users/sjoer/Desktop/MCSM/plugins')
|
||||||
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins', name)
|
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
|
||||||
// ========================== UNIX ==============================
|
// ========================== UNIX ==============================
|
||||||
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/Documents/development/server/plugins', name)
|
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/Documents/development/server/plugins')
|
||||||
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Desktop/REMOTES/RemoteMinecraft/plugins', name)
|
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Desktop/REMOTES/RemoteMinecraft/plugins')
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
|
|
||||||
|
|
||||||
def registerCustomOutputTask(name, path, plugin) {
|
|
||||||
if (!System.properties['os.name'].toLowerCase().contains('windows'))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register('build' + name, Copy) {
|
|
||||||
group('development')
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
dependsOn ':shadowJar'
|
|
||||||
from(file('build/libs/' + plugin + '-' + version + '-all.jar'))
|
|
||||||
into(file(path))
|
|
||||||
rename { String fileName ->
|
|
||||||
fileName.replace(plugin + '-' + version + '-all.jar', plugin + ".jar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def registerCustomOutputTaskUnix(name, path, plugin) {
|
|
||||||
if(System.properties['os.name'].toLowerCase().contains('windows'))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register('build' + name, Copy) {
|
|
||||||
group('development')
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
dependsOn ':shadowJar'
|
|
||||||
from(file('build/libs/' + plugin + '-' + version + '-all.jar'))
|
|
||||||
into(file(path))
|
|
||||||
rename { String fileName ->
|
|
||||||
fileName.replace(plugin + '-' + version + '-all.jar', plugin + ".jar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gradle is weird sometimes, we need to delete the plugin yml from the build folder to actually filter properly.
|
* Gradle is weird sometimes, we need to delete the plugin yml from the build folder to actually filter properly.
|
||||||
*/
|
*/
|
||||||
@ -182,14 +146,70 @@ dependencies {
|
|||||||
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Gradle is using Java: " + JavaVersion.current());
|
if(JavaVersion.current().toString() != "17")
|
||||||
|
{
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println("=========================================================================================================")
|
||||||
|
System.err.println("You must run gradle on Java 17. You are using " + JavaVersion.current())
|
||||||
|
System.err.println()
|
||||||
|
System.err.println("=== For IDEs ===")
|
||||||
|
System.err.println("1. Configure the project for Java 17")
|
||||||
|
System.err.println("2. Configure the bundled gradle to use Java 17 in settings")
|
||||||
|
System.err.println()
|
||||||
|
System.err.println("=== For Command Line (gradlew) ===")
|
||||||
|
System.err.println("1. Install JDK 17 from https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html")
|
||||||
|
System.err.println("2. Set JAVA_HOME environment variable to the new jdk installation folder such as C:\\Program Files\\Java\\jdk-17.0.1")
|
||||||
|
System.err.println("3. Open a new command prompt window to get the new environment variables if need be.")
|
||||||
|
System.err.println("=========================================================================================================")
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.err.println()
|
||||||
|
System.exit(69);
|
||||||
|
}
|
||||||
|
|
||||||
def buildToolsJar = new File(buildDir, "buildtools/BuildTools.jar");
|
def buildToolsJar = new File(buildDir, "buildtools/BuildTools.jar");
|
||||||
def specialSourceJar = new File(buildDir, "specialsource/SpecialSource.jar");
|
def specialSourceJar = new File(buildDir, "specialsource/SpecialSource.jar");
|
||||||
def buildToolsFolder = new File(buildDir, "buildtools");
|
def buildToolsFolder = new File(buildDir, "buildtools");
|
||||||
|
def specialSourceFolder = new File(buildDir, "specialsource");
|
||||||
def buildToolsHint = new File(buildDir, "buildtools/craftbukkit-" + nmsVersion + ".jar");
|
def buildToolsHint = new File(buildDir, "buildtools/craftbukkit-" + nmsVersion + ".jar");
|
||||||
|
def outputShadeJar = new File(buildDir, "libs/Iris-" + version + "-all.jar");
|
||||||
|
def ssiJar = new File(buildDir, "specialsource/Iris-" + version + "-all.jar");
|
||||||
|
def ssobfJar = new File(buildDir, "specialsource/Iris-" + version + "-rmo.jar");
|
||||||
|
def homePath = System.properties['user.home']
|
||||||
|
def m2 = new File(homePath + "/.m2/repository")
|
||||||
|
def m2s = m2.getAbsolutePath();
|
||||||
|
|
||||||
// ======================== Building Mapped Jars =============================
|
// ======================== Building Mapped Jars =============================
|
||||||
task downloadBuildtools(type: Download) {
|
task downloadBuildtools(type: Download) {
|
||||||
|
group "remapping"
|
||||||
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
|
||||||
onlyIf{
|
onlyIf{
|
||||||
@ -198,6 +218,7 @@ task downloadBuildtools(type: Download) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task downloadSpecialSource(type: Download){
|
task downloadSpecialSource(type: Download){
|
||||||
|
group "remapping"
|
||||||
src 'https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar'
|
src 'https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar'
|
||||||
dest specialSourceJar
|
dest specialSourceJar
|
||||||
onlyIf{
|
onlyIf{
|
||||||
@ -207,6 +228,7 @@ task downloadSpecialSource(type: Download){
|
|||||||
|
|
||||||
task executeBuildTools(dependsOn: downloadBuildtools, type: JavaExec)
|
task executeBuildTools(dependsOn: downloadBuildtools, type: JavaExec)
|
||||||
{
|
{
|
||||||
|
group "remapping"
|
||||||
classpath = files(buildToolsJar)
|
classpath = files(buildToolsJar)
|
||||||
workingDir = buildToolsFolder
|
workingDir = buildToolsFolder
|
||||||
args = [
|
args = [
|
||||||
@ -221,4 +243,81 @@ task executeBuildTools(dependsOn: downloadBuildtools, type: JavaExec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.compileJava.dependsOn(executeBuildTools)
|
task copyBuildToSpecialSource(type: Copy)
|
||||||
|
{
|
||||||
|
group "remapping"
|
||||||
|
from outputShadeJar
|
||||||
|
into specialSourceFolder
|
||||||
|
dependsOn(downloadSpecialSource, shadowJar)
|
||||||
|
}
|
||||||
|
|
||||||
|
task specialSourceRemapObfuscate(type: JavaExec)
|
||||||
|
{
|
||||||
|
group "remapping"
|
||||||
|
dependsOn(copyBuildToSpecialSource, downloadSpecialSource, shadowJar)
|
||||||
|
workingDir = specialSourceFolder
|
||||||
|
classpath = files(specialSourceJar,
|
||||||
|
new File(m2s + "/org/spigotmc/spigot/"+spigotJarVersion+"/spigot-" + spigotJarVersion + "-remapped-mojang.jar"))
|
||||||
|
mainClass = "net.md_5.specialsource.SpecialSource"
|
||||||
|
args = [
|
||||||
|
"--live",
|
||||||
|
"-i",
|
||||||
|
ssiJar.getName(),
|
||||||
|
"-o",
|
||||||
|
ssobfJar.getName(),
|
||||||
|
"-m",
|
||||||
|
m2s + "/org/spigotmc/minecraft-server/"+spigotJarVersion+"/minecraft-server-" + spigotJarVersion + "-maps-mojang.txt",
|
||||||
|
"--reverse",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.compileJava.dependsOn(executeBuildTools)
|
||||||
|
|
||||||
|
task iris(type: Copy)
|
||||||
|
{
|
||||||
|
group "iris"
|
||||||
|
from ssobfJar
|
||||||
|
into buildDir
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace('Iris-' + version + '-rmo.jar', "Iris-" + version + ".jar")
|
||||||
|
}
|
||||||
|
dependsOn(specialSourceRemapObfuscate)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def registerCustomOutputTask(name, path) {
|
||||||
|
if (!System.properties['os.name'].toLowerCase().contains('windows'))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('build' + name, Copy) {
|
||||||
|
group('development')
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
dependsOn ':shadowJar'
|
||||||
|
from(new File(buildDir, "specialsource/Iris-" + version + "-rmo.jar"))
|
||||||
|
into(file(path))
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace(new File(buildDir, "specialsource/Iris-" + version + "-rmo.jar").getName(), "Iris.jar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def registerCustomOutputTaskUnix(name, path) {
|
||||||
|
if(System.properties['os.name'].toLowerCase().contains('windows'))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('build' + name, Copy) {
|
||||||
|
group('development')
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
dependsOn(iris)
|
||||||
|
from(new File(buildDir, "specialsource/Iris-" + version + "-rmo.jar"))
|
||||||
|
into(file(path))
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace(new File(buildDir, "specialsource/Iris-" + version + "-rmo.jar").getName(), "Iris.jar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user