prebuild update

This commit is contained in:
minjaesong
2024-11-30 22:49:01 +09:00
parent 450129f650
commit 869b751488

View File

@@ -1,6 +1,8 @@
package net.torvald.terrarum
import java.io.File
import java.time.ZoneOffset
import java.time.ZonedDateTime
/**
* Created by minjaesong on 2023-08-25.
@@ -63,12 +65,102 @@ Categories=Game;"""
f.writeText(s)
}
private fun markVersionNumberAndBuildDate(major: Int, minor: Int, patch: Int) {
val s = """name=${TerrarumAppConfiguration.GAME_NAME}
version=$major.$minor.$patch
builddate=${ZonedDateTime.now(ZoneOffset.UTC).toString().substring(0, 10)}
"""
val f = File("./out/build_autogen_buildinfo.properties")
f.delete()
f.writeText(s)
}
fun makeBasegameMetadata(major: Int, minor: Int, patch: Int) {
val s = """## this file is auto-generated using Prebuild.kt ##
# The name that will be displayed in-game
propername=${TerrarumAppConfiguration.GAME_NAME}
# The description
description=The game
# Translations to the description
# Two-character language code is interpreted as a superset of four-character code.
# For example, description_pt will be used for both ptPT and ptBR
description_bgBG=\u0418\u0433\u0440\u0430\u0442\u0430
description_csCZ=Hra
description_daDK=Spillet
description_de=Das Spiel
description_elGR=\u03A4\u03BF \u03C0\u03B1\u03B9\u03C7\u03BD\u03AF\u03B4\u03B9
description_es=El juego
description_fiFI=Peli
description_frFR=Le jeu
description_hiIN=\u0916\u0947\u0932
description_huHU=A j\u00E1t\u00E9k
description_isIC=Leikurinn
description_it=Il gioco
description_jaJP=\u57FA\u672C\u30B2\u30FC\u30E0
description_koKR=\uAE30\uBCF8 \uAC8C\uC784
description_nlNL=Het spel
description_noNB=Spillet
description_pt=O jogo
description_roRO=Joculzr
description_ruRU=\u0418\u0433\u0440\u0430
description_svSE=Spelet
description_thTH=\u0E40\u0E01\u0E21
description_trTR=Oyun
description_zhCN=\u57FA\u672C\u6E38\u620F
description_zhTW=\u57FA\u672C\u904A\u6232
# Author of the module
author=CuriousTo\uA75Bvald
# Root package name for the module
# The game will look for certain classes based on this package string, so don't mess up!
package=net.torvald.terrarum.modulebasegame
# Name of the entry script
# Entry script must inherit net.torvald.terrarum.ModuleEntryPoint
entrypoint=net.torvald.terrarum.modulebasegame.EntryPoint
# Release date in YYYY-MM-DD
releasedate=${ZonedDateTime.now(ZoneOffset.UTC).toString().substring(0, 10)}
# The version, must follow Semver 2.0.0 scheme (https://semver.org/)
version=$major.$minor.$patch
# External JAR that the module is compiled. If your module requires yet another library, the JAR must be compiled as a "Fatjar";
# Due to security reasons, loading an arbitrary JAR is not allowed.
jar=
# Sha256sum of the External JAR, if any
# The hash will not be checked if the game is running on the development mode
jarhash=
# Modules that must be pre-installed, separated by semicolons (;)
# Dependency syntax: "module's identification name (aka folder name) spaces allowed versionnumber"
# Version number:
# - a.b.c : the exact version a.b.c
# - a.b.c+ : Any version between a.b.c and a.b.16777215
# - a.b.* : Any version between a.b.0 and a.b.16777215
# - a.b+ : Any version between a.b.0 and a.16777215.16777215
# - a.* : Any version between a.0.0 and a.16777215.16777215
# - * : Any version between 0.0.0 and 65535.16777215.16777215
dependency=
"""
val f = File("./assets/mods/basegame/metadata.properties")
f.delete()
f.writeText(s)
}
fun main() {
val major = (App.VERSION_RAW ushr 48).toInt()
val minor = ((App.VERSION_RAW and 0xffff000000L) ushr 24).toInt()
val patch = (App.VERSION_RAW and 0xffffffL).toInt()
markVersionNumberAndBuildDate(major, minor, patch)
writeLinuxDesktop(major, minor, patch)
writeOSXPlist(major, minor, patch)
writeWindowsRC(major, minor, patch)
makeBasegameMetadata(major, minor, patch)
}