Vala project setup script
- Lua, Vala
This project is a lua script that automates the process of setting up a project with vala, meson and git. Similar to what happens when yo tell cargo or go to create a new project. It also sets up some helper scripts and a README with build instructions.
When experimenting with gtk and Vala I notices that I was copy-pasting files to bootstrap new projects and experiments all the time, replacing names by hand and … making mistakes. So I put everything into a lua script that helps me with bootstrapping Vala based projects (which at the time of writing, mid 2022 I still do on occasion)
Automatic generation of meson.build files
The script generates two buildfiles for meson, one in the projects root where meson finds it and a second one in the src folder that contains a list of all the files and your dependency list you probably want to extend.
It also gives you a script that you can call to update the list of files to be compiled (list of
*.vala files in the src directory) which is good enough for most projects.
One command to build and run
Building with meson is a multi command process, you have to tell meson to generate the build directory then you have to tell ninja to do the actual building, find the result and run it … too many braincycles wasted for my taste, this script gives you a
build and a
run script that can do all the work for you (the run script invoking the buildscript on every call)
Since you are in charge as soon as the script exits you can do whatever the hell you want with those.
Generates an initial README.md wich explains how to use the build-system
Probably most often asked question by everyone:
How do I build that thing?
This thing generates a README.md skeleton for you. (you still have to fill it with information, but at least you don't have to copypasta your explanation of how to use meson)
Optionally generates a hello world program
Sometimes its nice to have a bit of code that reminds one of the Language syntax … , this also helps with testing the setup script itself.
Sets up a git repository and makes the initial commit
Another two commands that you type in everytime and are everytime the same commands, so while I was at it I automated it.
I hope this helps people understand the code (you shouldn't let code that some random wierdo from the Internet wrote manage your projects without making sure that code does what you want).