Add CLI commands for common development tasks
Per the conversation in Discord starting just below here, this adds some pre-defined command-line scripts using Task.
Opened as a draft since I'm not sure if there's an appetite for it. I figure if it's not worth adding to main then people who are interested can just grab the config and use it themselves. It works in my testing, though would obviously benefit from someone else trying it out.
# Do the equivaliant of a dev Alpakit run and also copies the DLLs
task package:dev && task install
# Do the equivaliant of a release Alpakit run.
task package:release
# Do the equivelant of a "development editor" build in VS
task build:dev
# Regenerate VS project files
task vs:project
I've updated the CONTRIBUTING.md with specific instructions.
These were adapted from another project I'm working on where I started using Task because I have to run a bunch of extra commands as part of the build process, however I thought that there might be some benefit to something similar for FRM even though it doesn't have those other requirements.
- Not needing to wait for the UE Editor to open just to run Alpakit is nice.
- Builds run without the editor open can be faster since the extra free memory can be enough for another parallel build worker.
- This could provide a nice place for any other tasks that there are in the future (tests, etc).
There are some caveats and notes.
task installwon't work under Powershell.- It will work under a default "Git Bash" install on Windows.
- All the other tasks will work under PS.
- I really tried. PS (at least 5.x, which comes standard on Win 10 and 11) is just not really designed for easy automation. A lot of work is required just for it to properly report errors, which you get for free with Bash.
- As an example, Expand-Archive will happily extract a zip that doesn't exist to a directory that doesn't exist without throwing an error.
- The extra level of indirection from Task's generic CLI runner was also making things annoying.
- Worth noting that bash is available even on Windows Github Actions runners.
- I haven't added dependencies between tasks.
- E.g. having package:* run build:dev.
- Trivial to do but not strictly necessary for any of the tasks defined here.
- I thought about having it show an explicit error if ArduinoKit isn't present.
- That is very annoying to do without using Bash.
- My choice of using Task was pretty arbitrary.
- There's nothing similar available by default on Windows. Even Git Bash doesn't come with Make.
- Make isn't great when most targets are 'phony' (don't create specific files) and also assumes paths won't have spaces.
- The other option I know if is just. That's missing some (IMO) critical things, like the ability to skip up-to-date jobs.
- Task has some of the same eccentricities with variables which seem to plague other YAML-templating-based tools like Ansible. I've documented them inline.