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 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 if action.get('msbuild_use_call', True): | 3280 if action.get('msbuild_use_call', True): |
3281 cmd = 'call ' + cmd | 3281 cmd = 'call ' + cmd |
3282 commands.append(cmd) | 3282 commands.append(cmd) |
3283 # Add the custom build action for one input file. | 3283 # Add the custom build action for one input file. |
3284 description = ', and also '.join(descriptions) | 3284 description = ', and also '.join(descriptions) |
3285 | 3285 |
3286 # We can't join the commands simply with && because the command line will | 3286 # We can't join the commands simply with && because the command line will |
3287 # get too long. See also _AddActions: cygwin's setup_env mustn't be called | 3287 # get too long. See also _AddActions: cygwin's setup_env mustn't be called |
3288 # for every invocation or the command that sets the PATH will grow too | 3288 # for every invocation or the command that sets the PATH will grow too |
3289 # long. | 3289 # long. |
3290 command = ( | 3290 command = '\r\n'.join([c + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%' |
3291 '\r\nif %errorlevel% neq 0 exit /b %errorlevel%\r\n'.join(commands)) | 3291 for c in commands]) |
3292 _AddMSBuildAction(spec, | 3292 _AddMSBuildAction(spec, |
3293 primary_input, | 3293 primary_input, |
3294 inputs, | 3294 inputs, |
3295 outputs, | 3295 outputs, |
3296 command, | 3296 command, |
3297 description, | 3297 description, |
3298 sources_handled_by_action, | 3298 sources_handled_by_action, |
3299 actions_spec) | 3299 actions_spec) |
3300 return actions_spec, sources_handled_by_action | 3300 return actions_spec, sources_handled_by_action |
3301 | 3301 |
(...skipping 12 matching lines...) Expand all Loading... |
3314 action_spec.extend( | 3314 action_spec.extend( |
3315 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3315 # TODO(jeanluc) 'Document' for all or just if as_sources? |
3316 [['FileType', 'Document'], | 3316 [['FileType', 'Document'], |
3317 ['Command', command], | 3317 ['Command', command], |
3318 ['Message', description], | 3318 ['Message', description], |
3319 ['Outputs', outputs] | 3319 ['Outputs', outputs] |
3320 ]) | 3320 ]) |
3321 if additional_inputs: | 3321 if additional_inputs: |
3322 action_spec.append(['AdditionalInputs', additional_inputs]) | 3322 action_spec.append(['AdditionalInputs', additional_inputs]) |
3323 actions_spec.append(action_spec) | 3323 actions_spec.append(action_spec) |
OLD | NEW |