| 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 remove the build directory. | 8 the build should be clobbered, it will remove the build directory. |
| 9 | 9 |
| 10 A landmine is tripped when a builder checks out a different revision, and the | 10 A landmine is tripped when a builder checks out a different revision, and the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 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 ret = os.path.join(SRC_DIR, os.environ.get('CHROMIUM_OUT_DIR', 'out')) |
| 47 elif build_tool in ['msvs', 'vs', 'ib']: | |
| 48 ret = os.path.join(SRC_DIR, 'build') | |
| 49 else: | 47 else: |
| 50 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) | 48 raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) |
| 51 return os.path.abspath(ret) | 49 return os.path.abspath(ret) |
| 52 | 50 |
| 53 | 51 |
| 54 def clobber_if_necessary(new_landmines): | 52 def clobber_if_necessary(new_landmines): |
| 55 """Does the work of setting, planting, and triggering landmines.""" | 53 """Does the work of setting, planting, and triggering landmines.""" |
| 56 out_dir = get_build_dir(landmine_utils.builder()) | 54 out_dir = get_build_dir(landmine_utils.builder()) |
| 57 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) | 55 landmines_path = os.path.normpath(os.path.join(out_dir, '..', '.landmines')) |
| 58 try: | 56 try: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) | 121 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) |
| 124 output, _ = proc.communicate() | 122 output, _ = proc.communicate() |
| 125 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 123 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
| 126 clobber_if_necessary(landmines) | 124 clobber_if_necessary(landmines) |
| 127 | 125 |
| 128 return 0 | 126 return 0 |
| 129 | 127 |
| 130 | 128 |
| 131 if __name__ == '__main__': | 129 if __name__ == '__main__': |
| 132 sys.exit(main()) | 130 sys.exit(main()) |
| OLD | NEW |