Removed un-needed stuff

This commit is contained in:
coolGi
2024-02-18 16:07:51 +10:30
parent feb6dd41b7
commit 0c5f38a00b
2 changed files with 18 additions and 33 deletions
+15 -24
View File
@@ -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
}
}