Swift: make C++ code generation more self-contained

This is solving a papercut, where the C++ build was relying on the
local dbscheme file to be up-to-date, even if all the information for
building is actually in `schema.yml`. This made a pure C++ development
cycle with changes to `schema.yml` clumsy, as it required a further
dbscheme generation step.

Now for C++ the dbscheme is generated internally in the build files, and
thus a change in `schema.yml` is reflected immediately in the C++ build.

A `swift/codegen` step for checked in generated code (including the
dbscheme) is still required, but a developer can do it just before
running QL tests or committing, instead of during each C++
recompilation.

Some directory reorganization was also carried out, moving specific
generator modules to a new `generators` python package, and only leaving
the two drivers at the top level.
This commit is contained in:
Paolo Tranquilli
2022-05-17 16:58:34 +02:00
parent fbe7c5be81
commit 3a46db3f81
18 changed files with 50 additions and 65 deletions

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env python3
""" Driver script to run all cpp code generation """
from swift.codegen.generators import generator, dbschemegen, trapgen, cppgen
if __name__ == "__main__":
generator.run(dbschemegen, trapgen, cppgen)