Updating the Code Generator - DLR-SC/tigl GitHub Wiki
Generator updates can affect the whole build chain. So following summary should help developers keep track of dependencies, important paths and the process of testing (TiGL and Generator unit tests, Python tests).
- DLR-SC/cpacs_tigl_gen which is a fork from RISCSoftware/cpacs_tigl_gen
Note: Due to changes in generated files TiGL>3.4.0 is not compatible with older versions of the generator.
The generator version is integrated via git submodule. If TiGl requires a new generator version (e.g. your update):
- update the url in tigl/.gitmodules
- via command prompt (make sure to do this in your feature-branch):
>git submodule set-url thirdparty/cpacs_gen <new_path>
>git submodule update --init --remote thirdparty/cpacs_gen
>git submodule init
- push changes
TiGL relies on the CPACS Schema via XSD file (tigl/cpacs_gen_input/cpacs_schema.xsd), which is processed by the generator (set paths of tixi and tigl in CMAKE for building and executing the generator). It generates classes for each element, which can be customized via inheritance. If so make sure to update following input file for the generator: tigl/cpacs_gen_input/CustomTypes.txt .
You will find all input/output files here:
Generator input: tigl/cpacs_gen_input/*
Generated output: tigl/src/generated/*
Be sure not to customize a generated file! All changes will be overwritten next time the classes get generated. You will have to create the new class yourself (naming convention: CPACSType->CCPACSType).
Thus, if you update the generator:
- Test tigl with all generated changes
You can follow this Step by Step Guideline:
- Build generator
Run generator tests (some of which might still fail, if update contains changes in generated code)
Generate files
- Build/install TiGL
- Build TiGL tests
Run TiGL tests
- Build python bindings (CMAKE Flage TIGL_BINDINGS_PYTHON_INTERNAL = ON !)
Run Python tests manually see [# Conda environments]
-
If all tests run successfully, this is a good indication that the generator actually does what you intended it to do (-> reference files for tests might change for example if you update the generator to change it's output, now it's the time to update them and run generator tests again).
-
Don't forget to test and adjust the python bindings, especially when new types are added via CPACSSchema. (Under these circumstances update following file: tigl/bindings/python_internal/configuration.i)
The generator and tigl should work with the same conda environment for building and testing purposes. Compare readme.
If you want to test the python bindings you need to:
- build tigl with your changes
- [create a different environment, install tigl] (https://dlr-sc.github.io/tigl/doc/latest/tigl_installation.html)
- move the *.dll/.*so .pyc/.py files (e.g. in linux: from tigl/build/bindings/python_internal /tigl/build/lib) to your conda environment installation folder for tigl (linux paths could look like this: ./conda/envs//lib & ./conda/envs//lib/python/site-packages/tigl3, which is also where you will find tixi3)