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