diff --git a/build.gradle b/build.gradle index 7fc6958a7..26a133ee7 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/s registerCustomOutputTask('Coco', 'D://mcsm/plugins') registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/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') // ========================== UNIX ============================== registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins') @@ -53,14 +53,14 @@ NMS_BINDINGS.each { def value = it.value def nms = value.split("-")[0]; project(":nms:${key}") { - apply plugin: 'java' apply plugin: 'java-library' apply plugin: 'de.undercouch.download' + apply plugin: 'com.github.johnrengelman.shadow' dependencies { implementation project(":core") - implementation "org.spigotmc:spigot-api:${value}" - implementation "org.bukkit:craftbukkit:${value}:remapped-mojang" //[NMS] + compileOnly "org.spigotmc:spigot-api:${value}" + compileOnly "org.bukkit:craftbukkit:${value}:remapped-mojang" //[NMS] } def buildToolsJar = new File(rootProject.buildDir, "tools/BuildTools.jar") @@ -181,7 +181,16 @@ NMS_BINDINGS.each { dependsOn(specialSourceRemap) } + 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") + } + tasks.build.dependsOn(copySpecialSourceToBuild) + tasks.shadowJar.dependsOn(build) executeBuildTools.run() } } @@ -194,13 +203,6 @@ shadowJar { 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' - 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") } @@ -211,13 +213,13 @@ dependencies { } } -configurations.all { +configurations.configureEach { resolutionStrategy.cacheChangingModulesFor 60, 'minutes' resolutionStrategy.cacheDynamicVersionsFor 60, 'minutes' } allprojects { - getPlugins().apply("java") + apply plugin: 'java' repositories { mavenLocal { @@ -250,20 +252,20 @@ allprojects { implementation "net.kyori:adventure-text-minimessage:4.13.1" implementation 'net.kyori:adventure-platform-bukkit:4.3.0' 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 - implementation 'io.timeandspace:smoothie-map:2.0.2' - implementation 'it.unimi.dsi:fastutil:8.5.8' - implementation 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2' - implementation 'org.zeroturnaround:zt-zip:1.14' - implementation 'com.google.code.gson:gson:2.9.0' - implementation 'org.ow2.asm:asm:9.2' - implementation 'com.google.guava:guava:31.1-jre' - implementation 'bsf:bsf:2.4.0' - implementation 'rhino:js:1.7R2' - implementation 'com.github.ben-manes.caffeine:caffeine:3.0.6' - implementation 'org.apache.commons:commons-lang3:3.12.0' + compileOnly 'io.timeandspace:smoothie-map:2.0.2' + compileOnly 'it.unimi.dsi:fastutil:8.5.8' + compileOnly 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2' + compileOnly 'org.zeroturnaround:zt-zip:1.14' + compileOnly 'com.google.code.gson:gson:2.9.0' + compileOnly 'org.ow2.asm:asm:9.2' + compileOnly 'com.google.guava:guava:31.1-jre' + compileOnly 'bsf:bsf:2.4.0' + compileOnly 'rhino:js:1.7R2' + compileOnly 'com.github.ben-manes.caffeine:caffeine:3.0.6' + compileOnly 'org.apache.commons:commons-lang3:3.12.0' } /** @@ -307,6 +309,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) { if (!System.properties['os.name'].toLowerCase().contains('windows')) { return; @@ -324,6 +335,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) { if (System.properties['os.name'].toLowerCase().contains('windows')) { return; @@ -341,4 +369,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) \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 76a806aa6..1f5f12617 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,18 +47,18 @@ compileJava { */ dependencies { // Provided or Classpath - implementation 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT' - implementation 'org.apache.logging.log4j:log4j-api:2.19.0' - implementation 'org.apache.logging.log4j:log4j-core:2.19.0' - implementation 'commons-lang:commons-lang:2.6' - implementation 'com.github.oshi:oshi-core:5.8.5' + compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT' + compileOnly 'org.apache.logging.log4j:log4j-api:2.19.0' + compileOnly 'org.apache.logging.log4j:log4j-core:2.19.0' + compileOnly 'commons-lang:commons-lang:2.6' + compileOnly 'com.github.oshi:oshi-core:5.8.5' // Third Party Integrations - implementation 'com.ticxo.playeranimator:PlayerAnimator:R1.2.7' - implementation 'com.github.oraxen:oraxen:1.158.0' - implementation 'com.github.LoneDev6:api-itemsadder:3.4.1-r4' - implementation 'com.github.PlaceholderAPI:placeholderapi:2.11.3' - implementation 'com.github.Ssomar-Developement:SCore:4.23.10.8' + compileOnly 'com.ticxo.playeranimator:PlayerAnimator:R1.2.7' + compileOnly 'com.github.oraxen:oraxen:1.158.0' + compileOnly 'com.github.LoneDev6:api-itemsadder:3.4.1-r4' + compileOnly 'com.github.PlaceholderAPI:placeholderapi:2.11.3' + compileOnly 'com.github.Ssomar-Developement:SCore:4.23.10.8' //implementation files('libs/CustomItems.jar') }