Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: why build most of api from XML in build.rs? #64

Closed
mrghosti3 opened this issue Mar 14, 2024 · 3 comments
Closed

Question: why build most of api from XML in build.rs? #64

mrghosti3 opened this issue Mar 14, 2024 · 3 comments

Comments

@mrghosti3
Copy link
Contributor

As per the title, I want to know why this library is designed as such to build most of api from XML spec.

@brettfo
Copy link
Member

brettfo commented Mar 14, 2024

There's a lot of code that would be duplicated and it's not uncommon to need to update how a value is read/written, so rather than updating hundreds of lines, it's easier to update an XML file and a little bit of the codegen.

As a quick example, HeaderVariablesSpec.xml is 325 lines long, and the generated file is 3335, so there's a whole order of magnitude difference. EntitiesSpec.xml is 1341 lines, generated is 4737.

@brettfo
Copy link
Member

brettfo commented Mar 14, 2024

A good example is recent PR #56. It changes a lot of how a test-only JSON parsable version is generated. Rather than manually change thousands of lines, that PR is only 150 lines long.

@mrghosti3
Copy link
Contributor Author

Understood. That explains it then. Gonna play around with macros in maybe replacing build script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants