Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | # Copyright 2019 Google LLC. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | import glob |
| 6 | import os |
| 7 | head = '''# Copyright 2019 Google LLC. |
| 8 | # Use of this source code is governed by a BSD-style license that can be |
| 9 | # found in the LICENSE file. |
| 10 | ''' |
| 11 | def gni(path, name, files): |
| 12 | with open(path, 'w') as o: |
| 13 | o.write('%s\n%s = get_path_info([\n' % (head, name)) |
| 14 | for x in sorted(files): |
| 15 | o.write(' "%s",\n' % x) |
| 16 | o.write('], "abspath")\n') |
| 17 | if __name__ == '__main__': |
| 18 | os.chdir(os.path.dirname(__file__)) |
| 19 | gni('examples.gni', 'examples_sources', glob.glob('../docs/examples/*.cpp')) |