OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import fnmatch | 5 import fnmatch |
6 import imp | 6 import imp |
7 import logging | 7 import logging |
8 import modulefinder | 8 import modulefinder |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 # Page set paths are relative to their runner script, not relative to us. | 85 # Page set paths are relative to their runner script, not relative to us. |
86 util.GetBaseDir = lambda: base_dir | 86 util.GetBaseDir = lambda: base_dir |
87 # TODO: Loading the page set will automatically download its Cloud Storage | 87 # TODO: Loading the page set will automatically download its Cloud Storage |
88 # deps. This is really expensive, and we don't want to do this by default. | 88 # deps. This is really expensive, and we don't want to do this by default. |
89 page_set = test_obj.CreatePageSet(options) | 89 page_set = test_obj.CreatePageSet(options) |
90 | 90 |
91 # Add all of its serving_dirs as dependencies. | 91 # Add all of its serving_dirs as dependencies. |
92 for serving_dir in page_set.serving_dirs: | 92 for serving_dir in page_set.serving_dirs: |
93 yield serving_dir | 93 yield serving_dir |
| 94 for page in page_set: |
| 95 if page.is_file: |
| 96 yield page.serving_dir |
94 | 97 |
95 | 98 |
96 def FindExcludedFiles(files, options): | 99 def FindExcludedFiles(files, options): |
97 def MatchesConditions(path, conditions): | 100 def MatchesConditions(path, conditions): |
98 for condition in conditions: | 101 for condition in conditions: |
99 if condition(path): | 102 if condition(path): |
100 return True | 103 return True |
101 return False | 104 return False |
102 | 105 |
103 # Define some filters for files. | 106 # Define some filters for files. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 255 |
253 def Run(self, args): | 256 def Run(self, args): |
254 paths = args.positional_args | 257 paths = args.positional_args |
255 dependencies = FindDependencies(paths, args) | 258 dependencies = FindDependencies(paths, args) |
256 if args.zip: | 259 if args.zip: |
257 ZipDependencies(paths, dependencies, args) | 260 ZipDependencies(paths, dependencies, args) |
258 print 'Zip archive written to %s.' % args.zip | 261 print 'Zip archive written to %s.' % args.zip |
259 else: | 262 else: |
260 print '\n'.join(sorted(dependencies)) | 263 print '\n'.join(sorted(dependencies)) |
261 return 0 | 264 return 0 |
OLD | NEW |