Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from in- to excludes for resource inclusion #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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