Skip to content

Commit

Permalink
Switch from in- to excludes for resource inclusion
Browse files Browse the repository at this point in the history
As nearly all resources found in the vanilla jar are desired to be
included in paper, an include list is not ideal. Instead, this commit
changes the copy resource tasks to an exclude-based filter.
  • Loading branch information
lynxplay committed Mar 9, 2022
1 parent 9496216 commit 9cc1c49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ open class AllTasks(
val copyResources by tasks.registering<CopyResources> {
inputJar.set(applyMergedAt.flatMap { it.outputJar })
vanillaJar.set(extractFromBundler.flatMap { it.serverJar })
includes.set(listOf("/data/**", "/assets/**", "version.json", "yggdrasil_session_pubkey.der", "pack.mcmeta", "flightrecorder-config.jfc"))
excludes.convention(listOf("**/*.class", "/META-INF/**"))

outputJar.set(cache.resolve(FINAL_REMAPPED_JAR))
}
Expand Down
6 changes: 3 additions & 3 deletions paperweight-lib/src/main/kotlin/tasks/CopyResources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class CopyResources : BaseTask() {
abstract val vanillaJar: RegularFileProperty

@get:Input
abstract val includes: ListProperty<String>
abstract val excludes: ListProperty<String>

@get:OutputFile
abstract val outputJar: RegularFileProperty
Expand All @@ -55,8 +55,8 @@ abstract class CopyResources : BaseTask() {

fs.copy {
from(archives.zipTree(vanillaJar)) {
for (inc in this@CopyResources.includes.get()) {
include(inc)
for (inc in this@CopyResources.excludes.get()) {
exclude(inc)
}
}
from(archives.zipTree(inputJar))
Expand Down

0 comments on commit 9cc1c49

Please sign in to comment.