OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Adaptor script called through build/isolate.gypi. | 6 """Adaptor script called through build/isolate.gypi. |
7 | 7 |
8 Creates a wrapping .isolate which 'includes' the original one, that can be | 8 Creates a wrapping .isolate which 'includes' the original one, that can be |
9 consumed by tools/swarming_client/isolate.py. Path variables are determined | 9 consumed by tools/swarming_client/isolate.py. Path variables are determined |
10 based on the current working directory. The relative_cwd in the .isolated file | 10 based on the current working directory. The relative_cwd in the .isolated file |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 return i[:-4] | 170 return i[:-4] |
171 if i.endswith('.dylib.TOC'): | 171 if i.endswith('.dylib.TOC'): |
172 # Remove only the suffix .TOC, not the .dylib! | 172 # Remove only the suffix .TOC, not the .dylib! |
173 return i[:-4] | 173 return i[:-4] |
174 if i.endswith('.dll.lib'): | 174 if i.endswith('.dll.lib'): |
175 # Remove only the suffix .lib, not the .dll! | 175 # Remove only the suffix .lib, not the .dll! |
176 return i[:-4] | 176 return i[:-4] |
177 return i | 177 return i |
178 | 178 |
179 def f(i): | 179 def f(i): |
| 180 # This script is only for adding new binaries that are created as part of |
| 181 # the component build. |
| 182 ext = os.path.splitext(i)[1] |
| 183 if ext not in ['.dll', '.so', '.dylib']: |
| 184 return False |
| 185 |
180 # Check for execute access and strip directories. This gets rid of all the | 186 # Check for execute access and strip directories. This gets rid of all the |
181 # phony rules. | 187 # phony rules. |
182 p = os.path.join(build_dir, i) | 188 p = os.path.join(build_dir, i) |
183 return os.access(p, os.X_OK) and not os.path.isdir(p) | 189 return os.access(p, os.X_OK) and not os.path.isdir(p) |
184 | 190 |
185 return filter(f, map(filter_item, dependencies)) | 191 return filter(f, map(filter_item, dependencies)) |
186 | 192 |
187 | 193 |
188 def create_wrapper(args, isolate_index, isolated_index): | 194 def create_wrapper(args, isolate_index, isolated_index): |
189 """Creates a wrapper .isolate that add dynamic libs. | 195 """Creates a wrapper .isolate that add dynamic libs. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 299 |
294 swarming_client = os.path.join(SRC_DIR, 'tools', 'swarming_client') | 300 swarming_client = os.path.join(SRC_DIR, 'tools', 'swarming_client') |
295 sys.stdout.flush() | 301 sys.stdout.flush() |
296 result = subprocess.call( | 302 result = subprocess.call( |
297 [sys.executable, os.path.join(swarming_client, 'isolate.py')] + args) | 303 [sys.executable, os.path.join(swarming_client, 'isolate.py')] + args) |
298 return result | 304 return result |
299 | 305 |
300 | 306 |
301 if __name__ == '__main__': | 307 if __name__ == '__main__': |
302 sys.exit(main()) | 308 sys.exit(main()) |
OLD | NEW |