# 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 $1 -name=$2` on Unix.

Call python find.py <directory> <glob> to list all files matching glob under
directory (recursively).  E.g.
   $ python find.py ../tests/ '*.cpp'
will print all .cpp files under ../tests/.
'''

import fnmatch
import os
import sys

for d, kids, files in os.walk(sys.argv[1]):
  for f in files:
    if fnmatch.fnmatch(f, sys.argv[2]):
      print os.path.join(d, f).replace('\\', '/')  # Gyp wants Unix paths.

# 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 $1 -name=$2` on Unix.

Call python find.py <directory> <glob> to list all files matching glob under
directory (recursively).  E.g.
   $ python find.py ../tests/ '*.cpp'
will print all .cpp files under ../tests/.
'''

import fnmatch
import os
import sys

for d, kids, files in os.walk(sys.argv[1]):
  files.sort()
  for f in files:
    if fnmatch.fnmatch(f, sys.argv[2]):
      print os.path.join(d, f).replace('\\', '/')  # Gyp wants Unix paths.

Sort build files for consistent link order.
Sort build files for consistent link order.

Prior to the introduction of find.py, GMs were liked in the order they
were listed in the gypi file, which was generally alphabetically. This
made it fairly easy to predict where slides would show up in SampleApp
and the order was consistent. This simply sorts the list of files in
find.py to restore the expectation that files should be listed in the
build in alphabetical order.

Review URL: https://codereview.chromium.org/1144973003
