skia2/tools/fiddle/make_all_examples_cpp.py
Kevin Lubick d4bcb486ef Change relative includes to be absolute
Having all includes to skia source will make generating
BAZEL rules easier.

Change-Id: I318dfc88e736a62da151098bebbee8d7b357d963
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474736
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-22 17:03:26 +00:00

18 lines
698 B
Python
Executable File

#! /usr/bin/env python
# Copyright 2019 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
''' Run this script to re-generate the `all_examples.cpp` file after adding or
deleting example fiddles. '''
import glob
import os
os.chdir(os.path.dirname(__file__))
with open('all_examples.cpp', 'w') as o:
o.write('// Copyright 2019 Google LLC.\n// Use of this source code is '
'governed by a BSD-style license that can be found in the '
'LICENSE file.\n')
for path in sorted(glob.glob('../../docs/examples/*.cpp')):
# strip ../../
path = path[6:]
o.write('#include "%s"\n' % path)