mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 06:11:06 +00:00
Merge pull request #1057 from CrazyDev05/single_nms
add ability to only compile for one mc version
This commit is contained in:
+142
-95
@@ -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)
|
||||||
@@ -34,7 +36,7 @@ registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/s
|
|||||||
registerCustomOutputTask('Coco', 'D://mcsm/plugins')
|
registerCustomOutputTask('Coco', 'D://mcsm/plugins')
|
||||||
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
|
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
|
||||||
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.19.4/plugins')
|
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.19.4/plugins')
|
||||||
registerCustomOutputTask('CrazyDev22', 'C://Users/Julian/Desktop/server/plugins')
|
registerCustomOutputTask('CrazyDev22', 'v1_20_R2', 'C://Users/Julian/Desktop/server/plugins')
|
||||||
registerCustomOutputTask('Pixel', 'C://Users/repix/Iris Dimension Engine/1.20.1 - Iris Coding/plugins')
|
registerCustomOutputTask('Pixel', 'C://Users/repix/Iris Dimension Engine/1.20.1 - Iris Coding/plugins')
|
||||||
// ========================== UNIX ==============================
|
// ========================== UNIX ==============================
|
||||||
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
|
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
|
||||||
@@ -54,14 +56,14 @@ NMS_BINDINGS.each {
|
|||||||
def value = it.value
|
def value = it.value
|
||||||
def nms = value.split("-")[0];
|
def nms = value.split("-")[0];
|
||||||
project(":nms:${key}") {
|
project(":nms:${key}") {
|
||||||
apply plugin: 'java'
|
|
||||||
apply plugin: 'java-library'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'de.undercouch.download'
|
apply plugin: 'de.undercouch.download'
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(":core")
|
implementation project(":core")
|
||||||
implementation "org.spigotmc:spigot-api:${value}"
|
compileOnly "org.spigotmc:spigot-api:${value}"
|
||||||
implementation "org.bukkit:craftbukkit:${value}:remapped-mojang" //[NMS]
|
compileOnly "org.bukkit:craftbukkit:${value}:remapped-mojang" //[NMS]
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildToolsJar = new File(rootProject.buildDir, "tools/BuildTools.jar")
|
def buildToolsJar = new File(rootProject.buildDir, "tools/BuildTools.jar")
|
||||||
@@ -81,29 +83,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 = [
|
||||||
@@ -117,72 +109,91 @@ 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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.build.dependsOn(copySpecialSourceToBuild)
|
shadowJar {
|
||||||
|
append("plugin.yml")
|
||||||
|
relocate('com.dfsek.paralithic', 'com.volmit.iris.util.paralithic')
|
||||||
|
relocate('io.papermc.lib', 'com.volmit.iris.util.paper')
|
||||||
|
relocate('net.kyori', 'com.volmit.iris.util.kyori')
|
||||||
|
archiveFileName.set("Iris-${project.name}.jar")
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
specialSourceRemap.accept(archiveFile.get().asFile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.build.dependsOn(specialSourceRemap)
|
||||||
executeBuildTools.run()
|
executeBuildTools.run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,13 +206,6 @@ shadowJar {
|
|||||||
relocate 'com.dfsek.paralithic', 'com.volmit.iris.util.paralithic'
|
relocate 'com.dfsek.paralithic', 'com.volmit.iris.util.paralithic'
|
||||||
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'
|
||||||
dependencies {
|
|
||||||
include(dependency('io.papermc:paperlib'))
|
|
||||||
include(dependency('com.dfsek:Paralithic'))
|
|
||||||
include(dependency('net.kyori:'))
|
|
||||||
include(project(":core"))
|
|
||||||
NMS_BINDINGS.each {include(project(":nms:${it.key}"))}
|
|
||||||
}
|
|
||||||
archiveFileName.set("Iris-${project.version}.jar")
|
archiveFileName.set("Iris-${project.version}.jar")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,13 +216,13 @@ dependencies {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations.all {
|
configurations.configureEach {
|
||||||
resolutionStrategy.cacheChangingModulesFor 60, 'minutes'
|
resolutionStrategy.cacheChangingModulesFor 60, 'minutes'
|
||||||
resolutionStrategy.cacheDynamicVersionsFor 60, 'minutes'
|
resolutionStrategy.cacheDynamicVersionsFor 60, 'minutes'
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
getPlugins().apply("java")
|
apply plugin: 'java'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal {
|
mavenLocal {
|
||||||
@@ -251,20 +255,20 @@ allprojects {
|
|||||||
implementation "net.kyori:adventure-text-minimessage:4.13.1"
|
implementation "net.kyori:adventure-text-minimessage:4.13.1"
|
||||||
implementation 'net.kyori:adventure-platform-bukkit:4.3.0'
|
implementation 'net.kyori:adventure-platform-bukkit:4.3.0'
|
||||||
implementation 'net.kyori:adventure-api:4.13.1'
|
implementation 'net.kyori:adventure-api:4.13.1'
|
||||||
implementation 'io.lumine:Mythic-Dist:5.2.1'
|
compileOnly 'io.lumine:Mythic-Dist:5.2.1'
|
||||||
|
|
||||||
// Dynamically Loaded
|
// Dynamically Loaded
|
||||||
implementation 'io.timeandspace:smoothie-map:2.0.2'
|
compileOnly 'io.timeandspace:smoothie-map:2.0.2'
|
||||||
implementation 'it.unimi.dsi:fastutil:8.5.8'
|
compileOnly 'it.unimi.dsi:fastutil:8.5.8'
|
||||||
implementation 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'
|
compileOnly 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'
|
||||||
implementation 'org.zeroturnaround:zt-zip:1.14'
|
compileOnly 'org.zeroturnaround:zt-zip:1.14'
|
||||||
implementation 'com.google.code.gson:gson:2.9.0'
|
compileOnly 'com.google.code.gson:gson:2.9.0'
|
||||||
implementation 'org.ow2.asm:asm:9.2'
|
compileOnly 'org.ow2.asm:asm:9.2'
|
||||||
implementation 'com.google.guava:guava:31.1-jre'
|
compileOnly 'com.google.guava:guava:31.1-jre'
|
||||||
implementation 'bsf:bsf:2.4.0'
|
compileOnly 'bsf:bsf:2.4.0'
|
||||||
implementation 'rhino:js:1.7R2'
|
compileOnly 'rhino:js:1.7R2'
|
||||||
implementation 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6'
|
||||||
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
compileOnly 'org.apache.commons:commons-lang3:3.12.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -308,6 +312,15 @@ task setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NMS_BINDINGS.keySet().forEach {
|
||||||
|
tasks.register(it, Copy) {
|
||||||
|
group('single version')
|
||||||
|
dependsOn(":nms:${name}:shadowJar")
|
||||||
|
from new File(project(":nms:${name}").buildDir, "libs${File.separator}Iris-${name}.jar")
|
||||||
|
into buildDir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def registerCustomOutputTask(name, path) {
|
def registerCustomOutputTask(name, path) {
|
||||||
if (!System.properties['os.name'].toLowerCase().contains('windows')) {
|
if (!System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||||
return;
|
return;
|
||||||
@@ -325,6 +338,23 @@ def registerCustomOutputTask(name, path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def registerCustomOutputTask(name, nms, path) {
|
||||||
|
if (!System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('build' + name, Copy) {
|
||||||
|
group('development')
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
dependsOn(":${nms}")
|
||||||
|
from(new File(buildDir, "Iris-${nms}.jar"))
|
||||||
|
into(file(path))
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace("Iris-${nms}.jar", "Iris.jar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def registerCustomOutputTaskUnix(name, path) {
|
def registerCustomOutputTaskUnix(name, path) {
|
||||||
if (System.properties['os.name'].toLowerCase().contains('windows')) {
|
if (System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||||
return;
|
return;
|
||||||
@@ -342,4 +372,21 @@ def registerCustomOutputTaskUnix(name, path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def registerCustomOutputTaskUnix(name, nms, path) {
|
||||||
|
if (System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('build' + name, Copy) {
|
||||||
|
group('development')
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
dependsOn(":${nms}")
|
||||||
|
from(new File(buildDir, "Iris-${nms}.jar"))
|
||||||
|
into(file(path))
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName.replace("Iris-${nms}.jar", "Iris.jar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.build.dependsOn(shadowJar)
|
tasks.build.dependsOn(shadowJar)
|
||||||
+10
-10
@@ -47,18 +47,18 @@ compileJava {
|
|||||||
*/
|
*/
|
||||||
dependencies {
|
dependencies {
|
||||||
// Provided or Classpath
|
// Provided or Classpath
|
||||||
implementation 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
|
compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
|
||||||
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
|
compileOnly 'org.apache.logging.log4j:log4j-api:2.19.0'
|
||||||
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
|
compileOnly 'org.apache.logging.log4j:log4j-core:2.19.0'
|
||||||
implementation 'commons-lang:commons-lang:2.6'
|
compileOnly 'commons-lang:commons-lang:2.6'
|
||||||
implementation 'com.github.oshi:oshi-core:5.8.5'
|
compileOnly 'com.github.oshi:oshi-core:5.8.5'
|
||||||
|
|
||||||
// Third Party Integrations
|
// Third Party Integrations
|
||||||
implementation 'com.ticxo.playeranimator:PlayerAnimator:R1.2.7'
|
compileOnly 'com.ticxo.playeranimator:PlayerAnimator:R1.2.7'
|
||||||
implementation 'com.github.oraxen:oraxen:1.158.0'
|
compileOnly 'com.github.oraxen:oraxen:1.158.0'
|
||||||
implementation 'com.github.LoneDev6:api-itemsadder:3.4.1-r4'
|
compileOnly 'com.github.LoneDev6:api-itemsadder:3.4.1-r4'
|
||||||
implementation 'com.github.PlaceholderAPI:placeholderapi:2.11.3'
|
compileOnly 'com.github.PlaceholderAPI:placeholderapi:2.11.3'
|
||||||
implementation 'com.github.Ssomar-Developement:SCore:4.23.10.8'
|
compileOnly 'com.github.Ssomar-Developement:SCore:4.23.10.8'
|
||||||
//implementation files('libs/CustomItems.jar')
|
//implementation files('libs/CustomItems.jar')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user