Name Date Size #Lines LOC

..--

.style.yapfH A D25-Apr-202530 32

README.mdH A D25-Apr-2025597 2115

gn_ast.pyH A D25-Apr-202510.9 KiB374295

gn_editor.pyH A D25-Apr-202517.3 KiB437359

jni_refactor.pyH A D25-Apr-20255.2 KiB156120

json_gn_editor.pyH A D25-Apr-202523 KiB564447

json_gn_editor_test.pyH A D25-Apr-20253.8 KiB120101

utils.pyH A D25-Apr-20251.2 KiB3621

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