| 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 25 matching lines...) Expand all Loading... |
| 36 r'c:\b\build\slave\win\build\src\out' | 36 r'c:\b\build\slave\win\build\src\out' |
| 37 '/mnt/data/b/build/slave/linux/build/src/out' | 37 '/mnt/data/b/build/slave/linux/build/src/out' |
| 38 '/b/build/slave/ios_rel_device/build/src/xcodebuild' | 38 '/b/build/slave/ios_rel_device/build/src/xcodebuild' |
| 39 | 39 |
| 40 Keep this function in sync with tools/build/scripts/slave/compile.py | 40 Keep this function in sync with tools/build/scripts/slave/compile.py |
| 41 """ | 41 """ |
| 42 ret = None | 42 ret = None |
| 43 if build_tool == 'xcode': | 43 if build_tool == 'xcode': |
| 44 ret = os.path.join(SRC_DIR, 'xcodebuild') | 44 ret = os.path.join(SRC_DIR, 'xcodebuild') |
| 45 elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. | 45 elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios. |
| 46 ret = os.path.join(SRC_DIR, os.environ.get('CHROMIUM_OUT_DIR', 'out')) | 46 if ('CHROMIUM_OUT_DIR' not in os.environ and |
| 47 'output_dir' in landmine_utils.gyp_generator_flags()): |
| 48 output_dir = landmine_utils.gyp_generator_flags()['output_dir'] |
| 49 else: |
| 50 output_dir = os.environ.get('CHROMIUM_OUT_DIR', 'out') |
| 51 ret = os.path.join(SRC_DIR, output_dir) |
| 47 else: | 52 else: |
| 48 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) | 53 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) |
| 49 return os.path.abspath(ret) | 54 return os.path.abspath(ret) |
| 50 | 55 |
| 51 | 56 |
| 52 def clobber_if_necessary(new_landmines): | 57 def clobber_if_necessary(new_landmines): |
| 53 """Does the work of setting, planting, and triggering landmines.""" | 58 """Does the work of setting, planting, and triggering landmines.""" |
| 54 out_dir = get_build_dir(landmine_utils.builder()) | 59 out_dir = get_build_dir(landmine_utils.builder()) |
| 55 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) | 60 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) |
| 56 try: | 61 try: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) | 131 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) |
| 127 output, _ = proc.communicate() | 132 output, _ = proc.communicate() |
| 128 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 133 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
| 129 clobber_if_necessary(landmines) | 134 clobber_if_necessary(landmines) |
| 130 | 135 |
| 131 return 0 | 136 return 0 |
| 132 | 137 |
| 133 | 138 |
| 134 if __name__ == '__main__': | 139 if __name__ == '__main__': |
| 135 sys.exit(main()) | 140 sys.exit(main()) |
| OLD | NEW |