| OLD | NEW |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import ntpath | 6 import ntpath |
| 7 import os | 7 import os |
| 8 import posixpath | 8 import posixpath |
| 9 import re | 9 import re |
| 10 import subprocess | 10 import subprocess |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 platform_name = _ConfigPlatform(config_data) | 277 platform_name = _ConfigPlatform(config_data) |
| 278 return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name) | 278 return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name) |
| 279 | 279 |
| 280 | 280 |
| 281 def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, | 281 def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, |
| 282 quote_cmd, do_setup_env): | 282 quote_cmd, do_setup_env): |
| 283 | 283 |
| 284 if [x for x in cmd if '$(InputDir)' in x]: | 284 if [x for x in cmd if '$(InputDir)' in x]: |
| 285 input_dir_preamble = ( | 285 input_dir_preamble = ( |
| 286 'set INPUTDIR=$(InputDir)\n' | 286 'set INPUTDIR=$(InputDir)\n' |
| 287 'set INPUTDIR=%INPUTDIR:$(ProjectDir)=%\n' | 287 'if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n' |
| 288 'set INPUTDIR=%INPUTDIR:~0,-1%\n' | 288 'set INPUTDIR=%INPUTDIR:~0,-1%\n' |
| 289 ) | 289 ) |
| 290 else: | 290 else: |
| 291 input_dir_preamble = '' | 291 input_dir_preamble = '' |
| 292 | 292 |
| 293 if cygwin_shell: | 293 if cygwin_shell: |
| 294 # Find path to cygwin. | 294 # Find path to cygwin. |
| 295 cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0]) | 295 cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0]) |
| 296 # Prepare command. | 296 # Prepare command. |
| 297 direct_cmd = cmd | 297 direct_cmd = cmd |
| (...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3310 action_spec.extend( | 3310 action_spec.extend( |
| 3311 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3311 # TODO(jeanluc) 'Document' for all or just if as_sources? |
| 3312 [['FileType', 'Document'], | 3312 [['FileType', 'Document'], |
| 3313 ['Command', command], | 3313 ['Command', command], |
| 3314 ['Message', description], | 3314 ['Message', description], |
| 3315 ['Outputs', outputs] | 3315 ['Outputs', outputs] |
| 3316 ]) | 3316 ]) |
| 3317 if additional_inputs: | 3317 if additional_inputs: |
| 3318 action_spec.append(['AdditionalInputs', additional_inputs]) | 3318 action_spec.append(['AdditionalInputs', additional_inputs]) |
| 3319 actions_spec.append(action_spec) | 3319 actions_spec.append(action_spec) |
| OLD | NEW |