Introduce a Build Pipeline
Summary
Building a Duality game ("Publish Game") is currently a very hardcoded process. Replace this with an extensible, modular build process that is configurable via the editor.
Analysis
- The new build process should consist of a series of operations that are performed on the game data and binaries.
- Every build step is represented by a user class that implements an interface. Each should be as self-contained as possible with the least possible shared state.
- The current build process can be refactored to form the following build steps:
- Copy to target directory, filtered with a blacklist.
- Move to subdirectory, create batch file to run.
- Zip target directory.
- On the editor side, the build dialog should allow free editing of the list of build steps, including adding, removing, reordering or configuring steps.
- Allow to maintain multiple distinct build configurations.
- The set of available build steps can be derived from all available types in all editor plugins.
- Things that additional build steps could potentially do:
- Use IL magic to merge all assemblies and plugins into one.
- Crawl all scenes to apply Prefabs and then remove their links to improve load times.
- Crawl all scenes to perform additional optimization, like static batching or similar.
- Run third-party tools for deployment on other platforms.
- Rename the launcher file and set an icon.
- Change the serialization format to binary, or something custom that discards compatibility features for speed.
- ...
I'd vote for this one. The possibility of merging all assemblies and plugins would be very useful. Also, there could be an option to remove the documentation to reduce the output size, or an asset packer to have only 2 files (exe & pak).
Iam not really experienced with the editor UI itself but I could see if I can refactor the steps in PublishGameDialog to separate classes that each implement a 'IPublishStep' interface as a first step
Actually, I'd be kinda interested to deal with this issue myself when I get around to it 🙂 That said, if this becomes a blocker or pain point for you or others before that happens, feel free to post a design proposal for this as a comment and we can start discussing it.
Nah just looking for things to help with
Has there been work on this front?
Not yet, would have posted here otherwise. Caught up too much in other things and v3.0 so far, but definitely have it on my radar, and not with the lowest priority either. Having a proper, extensible build pipeline would be awesome.
I havent done anything with this.
I've found an open source alternative to ILMerge for merging all assemblie into one file. Maybe it can be useful at some point.
https://github.com/gluck/il-repack
Nice. Thanks for the link!