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 output_dir = None |
scottmg
2014/10/31 16:40:14
delete this line
| |
48 if ('CHROMIUM_OUT_DIR' not in os.environ and | |
49 'output_dir' in landmine_utils.gyp_generator_flags()): | |
50 output_dir = landmine_utils.gyp_generator_flags()['output_dir'] | |
51 else: | |
52 output_dir = os.environ.get('CHROMIUM_OUT_DIR', 'out') | |
53 ret = os.path.join(SRC_DIR, output_dir) | |
48 else: | 54 else: |
49 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) | 55 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) |
50 return os.path.abspath(ret) | 56 return os.path.abspath(ret) |
51 | 57 |
52 | 58 |
53 def clobber_if_necessary(new_landmines): | 59 def clobber_if_necessary(new_landmines): |
54 """Does the work of setting, planting, and triggering landmines.""" | 60 """Does the work of setting, planting, and triggering landmines.""" |
55 out_dir = get_build_dir(landmine_utils.builder()) | 61 out_dir = get_build_dir(landmine_utils.builder()) |
56 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) | 62 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) |
57 try: | 63 try: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) | 134 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) |
129 output, _ = proc.communicate() | 135 output, _ = proc.communicate() |
130 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 136 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
131 clobber_if_necessary(landmines) | 137 clobber_if_necessary(landmines) |
132 | 138 |
133 return 0 | 139 return 0 |
134 | 140 |
135 | 141 |
136 if __name__ == '__main__': | 142 if __name__ == '__main__': |
137 sys.exit(main()) | 143 sys.exit(main()) |
OLD | NEW |