Read WE version from manifest ourselves

(cherry picked from commit 947775b5e54aa9dd89d68ee0b382939796301902)
This commit is contained in:
Octavia Togami
2020-02-10 20:11:08 -05:00
committed by MattBDev
parent 752a2624f8
commit 692caeea8a
7 changed files with 111 additions and 51 deletions

View File

@ -120,7 +120,19 @@ fun Project.applyShadowConfiguration() {
}
}
val CLASSPATH = listOf("truezip", "truevfs", "js")
.map { "$it.jar" }
.flatMap { listOf(it, "WorldEdit/$it") }
.joinToString(separator = " ")
private val CLASSPATH = listOf("truezip", "truevfs", "js")
.map { "$it.jar" }
.flatMap { listOf(it, "WorldEdit/$it") }
.joinToString(separator = " ")
fun Project.addJarManifest(includeClasspath: Boolean = false) {
tasks.named<Jar>("jar") {
val attributes = mutableMapOf(
"WorldEdit-Version" to project(":worldedit-core").version
)
if (includeClasspath) {
attributes["Class-Path"] = CLASSPATH
}
manifest.attributes(attributes)
}
}