skia2/gyp/find.py
mtklein ada5a44f3b GN: get echo-headers sources via exec_script
exec_script runs every time gn does, which is explicitly on every one of our
bot runs.  That should be enough to obviate the .git/logs/HEAD hack.

Easiest way to do this was to swap around find.py's argument order to allow
multiple search directories.  This is the root of all the .gyp changes.

This moves the blacklist into BUILD.gn, which I think is nice.
It expands it a little as we're now searching recursively, into include/gpu/vk
which we can't include safely without the Vulkan SDK.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2205903004

Review-Url: https://codereview.chromium.org/2205903004
2016-08-02 14:28:26 -07:00

25 lines
693 B
Python

# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
find.py is a poor-man's emulation of `find -name=$1 $2` on Unix.
Call python find.py <glob> <directory>... to list all files matching glob under
directory (recursively). E.g.
$ python find.py '*.cpp' ../tests/ ../bench/
will print all .cpp files under ../tests/ and ../bench/.
'''
import fnmatch
import os
import sys
for directory in sys.argv[2:]:
for d, kids, files in os.walk(directory):
files.sort()
for f in files:
if fnmatch.fnmatch(f, sys.argv[1]):
print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.