[build] Move to yaml-based build config and manifest

Overall, I believe TOML to be a superior configuration format than YAML
in many situations, but it gets ugly quickly when nesting data
structures. The build configs were fine in TOML, but the manifest (and
my future plans for it) got unwieldy. I also did not want different
formats for each kind of configuration on top of also having a custom
DSL for interface definitions, so I've switched all the TOML to YAML.

Also of note is that this change actually adds structure to the manifest
file, which was little more than a CSV previously.
This commit is contained in:
Justin C. Miller
2021-09-05 13:07:09 -07:00
parent 186724e751
commit c9d713fc7f
11 changed files with 101 additions and 91 deletions

View File

@@ -3,7 +3,7 @@ class Target(dict):
@classmethod
def load(cls, root, name, config=None):
import toml
from . import load_config
if (name, config) in cls.__targets:
return cls.__targets[(name, config)]
@@ -17,9 +17,9 @@ class Target(dict):
basename += f"-{config}"
while basename is not None:
filename = str(configs / (basename + ".toml"))
filename = str(configs / (basename + ".yaml"))
depfiles.append(filename)
desc = toml.load(filename)
desc = load_config(filename)
basename = desc.get("extends")
dicts.append(desc.get("variables", dict()))