Fixed removing unused files form jar
This commit is contained in:
+16
-11
@@ -359,6 +359,21 @@ subprojects { p ->
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Delete un-needed files
|
||||
exclude "DistantHorizons.fabricLike.mixins.json" // This isnt required atm, but we will be using it later
|
||||
// exclude "*.distanthorizons.accesswidener"
|
||||
//// include "${accessWidenerVersion}.distanthorizons.accesswidener"
|
||||
// Jank solution to remove all unused accesswideners
|
||||
// The line above would work..., except forge requires the original accesswidener, meaning we require this jank solution
|
||||
exclude { file ->
|
||||
if (file.name.contains(".distanthorizons.accesswidener") && file.name != "${accessWidenerVersion}.distanthorizons.accesswidener") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -520,6 +535,7 @@ allprojects { p ->
|
||||
into(file(p.file("build/resources/main")))
|
||||
rename "${accessWidenerVersion}.distanthorizons.accesswidener", "distanthorizons.accesswidener"
|
||||
|
||||
|
||||
// Move the fabricLike mixin to its different places for each subproject
|
||||
if (findProject(":fabricLike")) {
|
||||
from project(":fabricLike").file("src/main/resources/DistantHorizons.fabricLike.mixins.json")
|
||||
@@ -533,17 +549,6 @@ allprojects { p ->
|
||||
into p.file("build/resources/main")
|
||||
}
|
||||
|
||||
// TODO: This method doesnt seem to actually remove it from the jar, probably called at incorrect spots
|
||||
task deleteDuplicatedCommonLoaderResources(type: Delete) {
|
||||
// Delete the duplicated fabricLike.mixins.json
|
||||
delete p.file("build/resources/main/DistantHorizons.fabricLike.mixins.json")
|
||||
|
||||
// Delete all the duplicated accesswideners
|
||||
delete fileTree(p.file("build/resources/main")) {
|
||||
include "*.distanthorizons.accesswidener"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
if (isMinecraftSubProject) {
|
||||
options.release = rootProject.java_version as Integer
|
||||
|
||||
@@ -122,13 +122,11 @@ task deleteResources(type: Delete) {
|
||||
processResources {
|
||||
dependsOn(copyCoreResources)
|
||||
dependsOn(copyCommonLoaderResources)
|
||||
dependsOn(deleteDuplicatedCommonLoaderResources)
|
||||
}
|
||||
|
||||
runClient {
|
||||
dependsOn(copyCoreResources)
|
||||
dependsOn(copyCommonLoaderResources)
|
||||
dependsOn(deleteDuplicatedCommonLoaderResources)
|
||||
jvmArgs "-XX:-OmitStackTraceInFastThrow"
|
||||
finalizedBy(deleteResources)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,6 @@ task deleteResources(type: Delete) {
|
||||
tasks.register('copyAllResources') {
|
||||
dependsOn(copyCoreResources)
|
||||
dependsOn(copyCommonLoaderResources)
|
||||
dependsOn(deleteDuplicatedCommonLoaderResources)
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
Reference in New Issue
Block a user