• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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