utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
562 stars 38 forks source link

GDKotlin Rework: Jvm configuration #601

Closed CedNaru closed 3 months ago

CedNaru commented 3 months ago

I split the whole configuration process into smaller functions, each with their responsibilities. All those functions are static and part of JvmConfiguration. They are then used together by GDKotlin to create a final version of the configuration.

I first parse the JSON file, then the command lines, making sure in both cases that the data provided is correct. If the JSON ends up being invalid or missing, I write a new one on disk. Then command line arguments replace the value set by the JSON if they exist. Last I added a bunch of sanity check to make sure the file is ready to be used for the platform.

Note: I didn't touch the JVM initialization itself. Aside of a few renames because of the changes in JvmConfiguration, it remains the same. The rework of that part is going to be in the next PR.