Include Minecraft version and required Java runtime in paperclip jar manifests
This commit is contained in:
parent
a5ae66c59a
commit
80ae37484a
1 changed files with 18 additions and 2 deletions
|
@ -109,11 +109,27 @@ abstract class CreateBundlerJar : ZippedTask() {
|
||||||
rootDir.resolve("META-INF/main-class").writeText(mainClass.get())
|
rootDir.resolve("META-INF/main-class").writeText(mainClass.get())
|
||||||
|
|
||||||
// copy version.json file
|
// copy version.json file
|
||||||
vanillaBundlerJar.path.openZip().use { fs ->
|
val versionJson = vanillaBundlerJar.path.openZip().use { fs ->
|
||||||
fs.getPath("/").resolve(FileEntry.VERSION_JSON).copyTo(rootDir.resolve("version.json"))
|
val source = fs.getPath("/").resolve(FileEntry.VERSION_JSON)
|
||||||
|
source.copyTo(rootDir.resolve("version.json"))
|
||||||
|
source.bufferedReader().use {
|
||||||
|
gson.fromJson(it, VersionJson::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
modifyManifest(rootDir.resolve("META-INF/MANIFEST.MF")) {
|
||||||
|
mainAttributes.putValue("Minecraft-Version", versionJson.name)
|
||||||
|
mainAttributes.putValue("Java-Runtime-Major-Version", versionJson.java_version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class VersionJson(
|
||||||
|
val id: String,
|
||||||
|
val name: String,
|
||||||
|
@Suppress("PropertyName")
|
||||||
|
val java_version: String,
|
||||||
|
)
|
||||||
|
|
||||||
private fun handleServerDependencies(rootDir: Path): List<FileEntry<ModuleId>> {
|
private fun handleServerDependencies(rootDir: Path): List<FileEntry<ModuleId>> {
|
||||||
val libraries = mutableListOf<FileEntry<ModuleId>>()
|
val libraries = mutableListOf<FileEntry<ModuleId>>()
|
||||||
val changedLibraries = mutableListOf<LibraryChange>()
|
val changedLibraries = mutableListOf<LibraryChange>()
|
||||||
|
|
Loading…
Reference in a new issue