| 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 a hook. If it detects that the build should |    7 This script runs every build as a hook. If it detects that the build should | 
|    8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The |    8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The | 
|    9 various build scripts will then check for the presence of this file and clobber |    9 various build scripts will then check for the presence of this file and clobber | 
|   10 accordingly. The script will also emit the reasons for the clobber to stdout. |   10 accordingly. The script will also emit the reasons for the clobber to stdout. | 
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  106   extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT') |  106   extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT') | 
|  107   if extra_script: |  107   if extra_script: | 
|  108     return options.landmine_scripts + [extra_script] |  108     return options.landmine_scripts + [extra_script] | 
|  109   else: |  109   else: | 
|  110     return options.landmine_scripts |  110     return options.landmine_scripts | 
|  111  |  111  | 
|  112  |  112  | 
|  113 def main(): |  113 def main(): | 
|  114   landmine_scripts = process_options() |  114   landmine_scripts = process_options() | 
|  115  |  115  | 
|  116   if landmine_utils.builder() == 'dump_dependency_json': |  116   if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'): | 
|  117     return 0 |  117     return 0 | 
|  118  |  118  | 
|  119   for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): |  119   for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): | 
|  120     landmines = [] |  120     landmines = [] | 
|  121     for s in landmine_scripts: |  121     for s in landmine_scripts: | 
|  122       proc = subprocess.Popen([sys.executable, s, '-t', target], |  122       proc = subprocess.Popen([sys.executable, s, '-t', target], | 
|  123                               stdout=subprocess.PIPE) |  123                               stdout=subprocess.PIPE) | 
|  124       output, _ = proc.communicate() |  124       output, _ = proc.communicate() | 
|  125       landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |  125       landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 
|  126     set_up_landmines(target, landmines) |  126     set_up_landmines(target, landmines) | 
|  127  |  127  | 
|  128   return 0 |  128   return 0 | 
|  129  |  129  | 
|  130  |  130  | 
|  131 if __name__ == '__main__': |  131 if __name__ == '__main__': | 
|  132   sys.exit(main()) |  132   sys.exit(main()) | 
| OLD | NEW |