Commit graph

2 commits

Author SHA1 Message Date
Joe Onorato
51497185fd Generate ninja files for api assembly and run ninja.
Change-Id: I003536e4ed4481acbdc041a6450106f8459d5978
2022-05-18 05:24:48 -07:00
Spandan Das
aacf2376a5 Lightweight ninja writer in Python
Summary:
- Create python classes for ninja vocbulary in `ninja_syntax.py`. These
  classes will be serialized to a ninja file
- Create a Writer class in `ninja_writer.py`. The current API supports
  adding variables,rules,build actions, etc. This can be extended in the
  future (See `test_ninja_writer.py` for examples)

Future Work:
 - Update the `Subninja` class once chDir is supported (aosp/2064612)
 - Support a width parameter that will be used to wrap long lines of
   text. This will improve readability of the generated files

Expected Use Case: Multi-tree build orchestrator

Test: python ./test_ninja_syntax.py
Test: python ./test_ninja_writer.py

Change-Id: I90c7ee69ddeb7c20c3fd4fca5a911dddbf2253bd
2022-05-12 17:47:29 +00:00