OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """ | 6 """ |
7 This script runs every build as the first hook (See DEPS). If it detects that | 7 This script runs every build as the first hook (See DEPS). If it detects that |
8 the build should be clobbered, it will delete the contents of the build | 8 the build should be clobbered, it will delete the contents of the build |
9 directory. | 9 directory. |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 r'c:\b\build\slave\win\build\src\out' | 37 r'c:\b\build\slave\win\build\src\out' |
38 '/mnt/data/b/build/slave/linux/build/src/out' | 38 '/mnt/data/b/build/slave/linux/build/src/out' |
39 '/b/build/slave/ios_rel_device/build/src/xcodebuild' | 39 '/b/build/slave/ios_rel_device/build/src/xcodebuild' |
40 | 40 |
41 Keep this function in sync with tools/build/scripts/slave/compile.py | 41 Keep this function in sync with tools/build/scripts/slave/compile.py |
42 """ | 42 """ |
43 ret = None | 43 ret = None |
44 if build_tool == 'xcode': | 44 if build_tool == 'xcode': |
45 ret = os.path.join(SRC_DIR, 'xcodebuild') | 45 ret = os.path.join(SRC_DIR, 'xcodebuild') |
46 elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. | 46 elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. |
47 ret = os.path.join(SRC_DIR, os.environ.get('CHROMIUM_OUT_DIR', 'out')) | 47 if ('CHROMIUM_OUT_DIR' not in os.environ and |
| 48 'output_dir' in landmine_utils.gyp_generator_flags()): |
| 49 output_dir = landmine_utils.gyp_generator_flags()['output_dir'] |
| 50 else: |
| 51 output_dir = os.environ.get('CHROMIUM_OUT_DIR', 'out') |
| 52 ret = os.path.join(SRC_DIR, output_dir) |
48 else: | 53 else: |
49 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) | 54 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) |
50 return os.path.abspath(ret) | 55 return os.path.abspath(ret) |
51 | 56 |
52 | 57 |
53 def clobber_if_necessary(new_landmines): | 58 def clobber_if_necessary(new_landmines): |
54 """Does the work of setting, planting, and triggering landmines.""" | 59 """Does the work of setting, planting, and triggering landmines.""" |
55 out_dir = get_build_dir(landmine_utils.builder()) | 60 out_dir = get_build_dir(landmine_utils.builder()) |
56 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) | 61 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) |
57 try: | 62 try: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) | 133 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) |
129 output, _ = proc.communicate() | 134 output, _ = proc.communicate() |
130 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 135 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
131 clobber_if_necessary(landmines) | 136 clobber_if_necessary(landmines) |
132 | 137 |
133 return 0 | 138 return 0 |
134 | 139 |
135 | 140 |
136 if __name__ == '__main__': | 141 if __name__ == '__main__': |
137 sys.exit(main()) | 142 sys.exit(main()) |
OLD | NEW |