From 0c5f38a00bd739c7b160e7d3cd3fcdd2669f6685 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 18 Feb 2024 16:07:51 +1030 Subject: [PATCH] Removed un-needed stuff --- build.gradle | 12 +++--------- forge/build.gradle | 39 +++++++++++++++------------------------ 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/build.gradle b/build.gradle index 95947703b..748a747fd 100644 --- a/build.gradle +++ b/build.gradle @@ -118,9 +118,9 @@ subprojects { p -> } tasks.withType(JavaCompile).configureEach { - source(project(":common").sourceSets.main.allSource) - source(project(":api").sourceSets.main.allSource) - source(project(":core").sourceSets.main.allSource) + source(project(":common").sourceSets.main.java) + source(project(":api").sourceSets.main.java) + source(project(":core").sourceSets.main.java) } } @@ -192,12 +192,6 @@ subprojects { p -> implementation("org.apache.logging.log4j:log4j-api:${rootProject.log4j_version}") implementation("org.apache.logging.log4j:log4j-core:${rootProject.log4j_version}") - // JOML - if (project.hasProperty("embed_joml") && embed_joml == "true") - forgeShadowMe("org.joml:joml:${rootProject.joml_version}") - else - implementation("org.joml:joml:${rootProject.joml_version}") - // JUnit tests implementation("org.junit.jupiter:junit-jupiter:5.8.2") implementation("org.junit.jupiter:junit-jupiter-engine:5.8.2") diff --git a/forge/build.gradle b/forge/build.gradle index 2aee85b34..3c79ac947 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -41,18 +41,6 @@ tasks.register('copyAllResources') { dependsOn(copyCommonLoaderResources) } -tasks.build.doLast { - copy { - from file("build/resources/main") - into file("build/sourcesSets/main") - } - - // TODO may not be necessary since we also do this before runClient - delete file("../common/build/libs") - delete file("../coreSubProjects/core/build/libs") - delete file("../coreSubProjects/api/build/libs") -} - processResources { @@ -66,12 +54,6 @@ afterEvaluate { // TODO this isn't a great place for these, but `tasks.build.doLast` doesn't always work and I'm not sure of a better place right now tasks.runClient.doFirst { - // copy the resources into the sourceSets folder so Forge can access them - copy { - from file("build/resources/main") - into file("build/sourcesSets/main") - } - // TODO can we just ignore these folders instead? // deleting them may cause issues if the OS locks the files // and it feels hacky @@ -102,7 +84,7 @@ sourcesJar { -// TODO this was specifically added for MC 1.20.4 and should probably be disabled for all MC versions below +// TODO this was specifically added for MC 1.20.4 and should not be used on MC versions prior to it // source: https://github.com/MinecraftForge/MinecraftForge/blob/5d0047753dfac0caaf5d97cc3f5c9a8b0990cb44/mdk/build.gradle#L209-L217 // // Merge the resources and classes into the same directory. @@ -110,10 +92,19 @@ sourcesJar { // And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem // This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later. sourceSets.each { - // all of our code and resources should be in the sourceSets/main/ folder for Forge 1.20.4+ - def dir = layout.buildDirectory.dir("sourcesSets/$it.name") - println "source name: [" + it.name + "]"// as of 2024-2-4 "it.name" only returned "main" and "test" - it.output.resourcesDir = dir - it.java.destinationDirectory = dir + if ( // Only run on MC 1.20.4 or later + // FIXME: Add an environment variable for the Major, Minor, and Patch version number of Minecraft + minecraft_version.split("\\.")[1].toInteger() >= 20 && + ( + minecraft_version.split("\\.").length > 1 && // Incase there isn't a minor version + minecraft_version.split("\\.")[2].toInteger() >= 4 + ) + ) { + // all of our code and resources should be in the sourceSets/main/ folder for Forge 1.20.4+ + def dir = layout.buildDirectory.dir("sourcesSets/$it.name") + println "source name: [" + it.name + "]"// as of 2024-2-4 "it.name" only returned "main" and "test" + it.output.resourcesDir = dir + it.java.destinationDirectory = dir + } }