• Home
Name Date Size #Lines LOC

..--

.style.yapfD04-Jul-202530 32

README.mdD04-Jul-2025597 2115

gn_ast.pyD04-Jul-202510.9 KiB374295

gn_editor.pyD04-Jul-202517.3 KiB437359

jni_refactor.pyD04-Jul-20255.2 KiB156120

json_gn_editor.pyD04-Jul-202523.8 KiB581462

json_gn_editor_test.pyD04-Jul-20253.8 KiB120101

utils.pyD04-Jul-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