Compare commits

...

1 commit

Author SHA1 Message Date
Jason Penilla
80ae37484a
Include Minecraft version and required Java runtime in paperclip jar manifests 2024-06-18 15:09:12 -07:00

View file

@ -109,11 +109,27 @@ abstract class CreateBundlerJar : ZippedTask() {
rootDir.resolve("META-INF/main-class").writeText(mainClass.get())
// copy version.json file
vanillaBundlerJar.path.openZip().use { fs ->
fs.getPath("/").resolve(FileEntry.VERSION_JSON).copyTo(rootDir.resolve("version.json"))
val versionJson = vanillaBundlerJar.path.openZip().use { fs ->
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>> {
val libraries = mutableListOf<FileEntry<ModuleId>>()
val changedLibraries = mutableListOf<LibraryChange>()