| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 os | 5 import os |
| 6 import re | 6 import re |
| 7 | 7 |
| 8 from pylib import constants | 8 from pylib import constants |
| 9 | 9 |
| 10 | 10 |
| 11 _BLACKLIST = [ | 11 _BLACKLIST = [ |
| 12 re.compile(r'.*OWNERS'), # Should never be included. | 12 re.compile(r'.*OWNERS'), # Should never be included. |
| 13 re.compile(r'.*\.crx'), # Chrome extension zip files. | 13 re.compile(r'.*\.crx'), # Chrome extension zip files. |
| 14 re.compile(r'.*\.so'), # Libraries packed into .apk. | 14 re.compile(r'.*\.so'), # Libraries packed into .apk. |
| 15 re.compile(r'.*Mojo.*manifest\.json'), # Some source_set()s pull these in. | 15 re.compile(r'.*Mojo.*manifest\.json'), # Some source_set()s pull these in. |
| 16 re.compile(r'.*\.py'), # Some test_support targets include python deps. | 16 re.compile(r'.*\.py'), # Some test_support targets include python deps. |
| 17 re.compile(r'.*\.stamp'), # Stamp files should never be included. |
| 17 | 18 |
| 18 # Some test_support targets include python deps. | 19 # Some test_support targets include python deps. |
| 19 re.compile(r'.*\.mojom\.js'), | 20 re.compile(r'.*\.mojom\.js'), |
| 20 | 21 |
| 21 # Chrome external extensions config file. | 22 # Chrome external extensions config file. |
| 22 re.compile(r'.*external_extensions\.json'), | 23 re.compile(r'.*external_extensions\.json'), |
| 23 | 24 |
| 24 # Exists just to test the compile, not to be run. | 25 # Exists just to test the compile, not to be run. |
| 25 re.compile(r'.*jni_generator_tests'), | 26 re.compile(r'.*jni_generator_tests'), |
| 26 | 27 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 96 |
| 96 output_directory = constants.GetOutDirectory() | 97 output_directory = constants.GetOutDirectory() |
| 97 abs_host_files = [ | 98 abs_host_files = [ |
| 98 os.path.abspath(os.path.join(output_directory, r)) | 99 os.path.abspath(os.path.join(output_directory, r)) |
| 99 for r in rel_host_files] | 100 for r in rel_host_files] |
| 100 filtered_abs_host_files = [ | 101 filtered_abs_host_files = [ |
| 101 host_file for host_file in abs_host_files | 102 host_file for host_file in abs_host_files |
| 102 if not any(blacklist_re.match(host_file) for blacklist_re in _BLACKLIST)] | 103 if not any(blacklist_re.match(host_file) for blacklist_re in _BLACKLIST)] |
| 103 return [(f, DevicePathComponentsFor(f, output_directory)) | 104 return [(f, DevicePathComponentsFor(f, output_directory)) |
| 104 for f in filtered_abs_host_files] | 105 for f in filtered_abs_host_files] |
| OLD | NEW |