Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.style.yapf | H A D | 25-Apr-2025 | 30 | 3 | 2 | |
README.md | H A D | 25-Apr-2025 | 597 | 21 | 15 | |
gn_ast.py | H A D | 25-Apr-2025 | 10.9 KiB | 374 | 295 | |
gn_editor.py | H A D | 25-Apr-2025 | 17.3 KiB | 437 | 359 | |
jni_refactor.py | H A D | 25-Apr-2025 | 5.2 KiB | 156 | 120 | |
json_gn_editor.py | H A D | 25-Apr-2025 | 23 KiB | 564 | 447 | |
json_gn_editor_test.py | H A D | 25-Apr-2025 | 3.8 KiB | 120 | 101 | |
utils.py | H A D | 25-Apr-2025 | 1.2 KiB | 36 | 21 |
README.md
1# GN AST 2 3A Python library for working with GN files via abstract syntax tree (AST). 4 5## JNI Refactor Example 6 7This library was originally created to perform the refactor within 8`jni_refactor.py`. The file is left as an example. 9 10```sh 11# To apply to all files: 12find -name BUILD.gn > file-list.txt 13# To apply to those that match a pattern: 14grep -r --files-with-matches --include "BUILD.gn" "some pattern" > file-list.txt 15 16# To run one-at-a-time: 17for f in $(cat file-list.txt); do python3 jni_refactor.py "$f"; done 18# To run in parallel: 19parallel python3 jni_refactor.py -- $(cat file-list.txt) 20``` 21