Skip to content

Commit 8030f7e

Browse files
committed
Properly name fork bundler/paperclip jars
1 parent 8109fa3 commit 8030f7e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/BundlerJarTasks.kt

+11-9
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,27 @@ class BundlerJarTasks(
9999
mainClass.set(mainClassString)
100100
extraManifestMainAttributes.convention(mapOf("Enable-Native-Access" to "ALL-UNNAMED"))
101101

102-
outputZip.set(layout.buildDirectory.file("libs/${rootProject.jarName("bundler", classifier)}"))
102+
outputZip.set(layout.buildDirectory.file(jarName("bundler", classifier).map { "libs/$it" }))
103103
}
104104
val paperclipJarTask = tasks.register<CreatePaperclipJar>(paperclipTaskName) {
105105
group = "bundling"
106106
description = "Build a runnable paperclip jar"
107107

108108
libraryChangesJson.set(bundlerJarTask.flatMap { it.libraryChangesJson })
109-
outputZip.set(layout.buildDirectory.file("libs/${rootProject.jarName("paperclip", classifier)}"))
109+
outputZip.set(layout.buildDirectory.file(jarName("paperclip", classifier).map { "libs/$it" }))
110110
}
111111
return bundlerJarTask to paperclipJarTask
112112
}
113113

114-
private fun Project.jarName(kind: String, classifier: String): String {
115-
return listOfNotNull(
116-
project.name,
117-
kind,
118-
project.version,
119-
classifier.takeIf { it.isNotBlank() },
120-
).joinToString("-") + ".jar"
114+
private fun Project.jarName(kind: String, classifier: String): Provider<String> {
115+
return bundlerJarName.map {
116+
listOfNotNull(
117+
it,
118+
kind,
119+
project.version,
120+
classifier.takeIf { c -> c.isNotBlank() },
121+
).joinToString("-") + ".jar"
122+
}
121123
}
122124

123125
private fun TaskProvider<CreateBundlerJar>.configureWith(

paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/SoftSpoonTasks.kt

+3
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ class SoftSpoonTasks(
299299
)
300300

301301
if (activeFork) {
302+
// setup output name conventions
303+
project.coreExt.bundlerJarName.convention(cfg.name)
304+
302305
// setup aggregate -server patching tasks
303306
upstreamConfigTasks.setupAggregateTasks(
304307
"Server",

0 commit comments

Comments
 (0)