Chromium Code Reviews| Index: scripts/slave/zip_build.py |
| diff --git a/scripts/slave/zip_build.py b/scripts/slave/zip_build.py |
| index 5047ec3919ed4201d0afdc898f910e418d136ff9..4c191832e88ccaed39cd5c45dafbf0404cb9a7c1 100755 |
| --- a/scripts/slave/zip_build.py |
| +++ b/scripts/slave/zip_build.py |
| @@ -141,28 +141,29 @@ def FileRegexBlacklist(options): |
| return '$NO_FILTER^' |
| -def MojomJSFiles(build_dir): |
| - """Lists all mojom JavaScript files that need to be included in the archive. |
| +def MojomFiles(build_dir, suffixes=None): |
|
Dirk Pranke
2014/09/09 19:50:37
Nit: there's only one caller of this routine. I'd
qsr
2014/09/10 07:53:08
Done.
|
| + """Lists all mojom files that need to be included in the archive. |
| Args: |
| build_dir: The build directory. |
| Returns: |
| - A list of mojom JavaScript file paths which are relative to the build |
| + A list of mojom file paths which are relative to the build |
| directory. |
| """ |
| walk_dirs = [ |
| 'gen/mojo', |
| 'gen/content/test/data', |
| ] |
| - mojom_js_files = [] |
| + mojom_files = [] |
| for walk_dir in walk_dirs: |
| walk_dir = os.path.join(build_dir, walk_dir) |
| for path, _, files in os.walk(walk_dir): |
| rel_path = os.path.relpath(path, build_dir) |
| - for mojom_js_file in fnmatch.filter(files, '*.mojom.js'): |
| - mojom_js_files.append(os.path.join(rel_path, mojom_js_file)) |
| - return mojom_js_files |
| + for suffix in suffixes or []: |
| + for mojom_file in fnmatch.filter(files, '*%s' % suffix): |
| + mojom_files.append(os.path.join(rel_path, mojom_file)) |
| + return mojom_files |
| def WriteRevisionFile(dirname, build_revision): |
| @@ -371,9 +372,9 @@ def Archive(options): |
| # TODO(yzshen): Once we have swarming support ready, we could use it to |
| # archive run time dependencies of tests and remove this step. |
| - mojom_js_files = MojomJSFiles(build_dir) |
| - print 'Include mojom JavaScript files: %s' % mojom_js_files |
| - zip_file_list.extend(mojom_js_files) |
| + mojom_files = MojomFiles(build_dir, ['.mojom.js', '_mojom.py']) |
| + print 'Include mojom files: %s' % mojom_files |
| + zip_file_list.extend(mojom_files) |
| zip_file = MakeUnversionedArchive(build_dir, staging_dir, zip_file_list, |
| unversioned_base_name, options.path_filter) |