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 re.compile(r'.*\.stamp'), # Stamp files should never be included. |
18 | 18 |
19 # Adding dependency on mojom targets adds data dependency on js bindings. | |
20 # Do not include those files except for JsToCppTest.mojom.js, which is | |
21 # required by webkit_unit_tests during runtime. | |
22 # TODO(yzshen): Remove this rule by generating foo_js that targets can | |
23 # explicitly depend on (crbug.com/603212). | |
24 re.compile(r'.*(?<!JsToCpp)\.mojom\.js'), | |
25 | |
26 # Chrome external extensions config file. | 19 # Chrome external extensions config file. |
27 re.compile(r'.*external_extensions\.json'), | 20 re.compile(r'.*external_extensions\.json'), |
28 | 21 |
29 # Exists just to test the compile, not to be run. | 22 # Exists just to test the compile, not to be run. |
30 re.compile(r'.*jni_generator_tests'), | 23 re.compile(r'.*jni_generator_tests'), |
31 | 24 |
32 # v8's blobs get packaged into APKs. | 25 # v8's blobs get packaged into APKs. |
33 re.compile(r'.*natives_blob.*\.bin'), | 26 re.compile(r'.*natives_blob.*\.bin'), |
34 re.compile(r'.*snapshot_blob.*\.bin'), | 27 re.compile(r'.*snapshot_blob.*\.bin'), |
35 ] | 28 ] |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 93 |
101 output_directory = constants.GetOutDirectory() | 94 output_directory = constants.GetOutDirectory() |
102 abs_host_files = [ | 95 abs_host_files = [ |
103 os.path.abspath(os.path.join(output_directory, r)) | 96 os.path.abspath(os.path.join(output_directory, r)) |
104 for r in rel_host_files] | 97 for r in rel_host_files] |
105 filtered_abs_host_files = [ | 98 filtered_abs_host_files = [ |
106 host_file for host_file in abs_host_files | 99 host_file for host_file in abs_host_files |
107 if not any(blacklist_re.match(host_file) for blacklist_re in _BLACKLIST)] | 100 if not any(blacklist_re.match(host_file) for blacklist_re in _BLACKLIST)] |
108 return [(f, DevicePathComponentsFor(f, output_directory)) | 101 return [(f, DevicePathComponentsFor(f, output_directory)) |
109 for f in filtered_abs_host_files] | 102 for f in filtered_abs_host_files] |
OLD | NEW |