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 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 cmd = action['command'] | 3014 cmd = action['command'] |
3015 # For most actions, add 'call' so that actions that invoke batch files | 3015 # For most actions, add 'call' so that actions that invoke batch files |
3016 # return and continue executing. msbuild_use_call provides a way to | 3016 # return and continue executing. msbuild_use_call provides a way to |
3017 # disable this but I have not seen any adverse effect from doing that | 3017 # disable this but I have not seen any adverse effect from doing that |
3018 # for everything. | 3018 # for everything. |
3019 if action.get('msbuild_use_call', True): | 3019 if action.get('msbuild_use_call', True): |
3020 cmd = 'call ' + cmd | 3020 cmd = 'call ' + cmd |
3021 commands.append(cmd) | 3021 commands.append(cmd) |
3022 # Add the custom build action for one input file. | 3022 # Add the custom build action for one input file. |
3023 description = ', and also '.join(descriptions) | 3023 description = ', and also '.join(descriptions) |
3024 command = ' && '.join(commands) | 3024 command = ( |
| 3025 '\r\nif %errorlevel% neq 0 exit /b %errorlevel%\r\n'.join(commands)) |
3025 _AddMSBuildAction(spec, | 3026 _AddMSBuildAction(spec, |
3026 primary_input, | 3027 primary_input, |
3027 inputs, | 3028 inputs, |
3028 outputs, | 3029 outputs, |
3029 command, | 3030 command, |
3030 description, | 3031 description, |
3031 sources_handled_by_action, | 3032 sources_handled_by_action, |
3032 actions_spec) | 3033 actions_spec) |
3033 return actions_spec, sources_handled_by_action | 3034 return actions_spec, sources_handled_by_action |
3034 | 3035 |
(...skipping 12 matching lines...) Expand all Loading... |
3047 action_spec.extend( | 3048 action_spec.extend( |
3048 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3049 # TODO(jeanluc) 'Document' for all or just if as_sources? |
3049 [['FileType', 'Document'], | 3050 [['FileType', 'Document'], |
3050 ['Command', command], | 3051 ['Command', command], |
3051 ['Message', description], | 3052 ['Message', description], |
3052 ['Outputs', outputs] | 3053 ['Outputs', outputs] |
3053 ]) | 3054 ]) |
3054 if additional_inputs: | 3055 if additional_inputs: |
3055 action_spec.append(['AdditionalInputs', additional_inputs]) | 3056 action_spec.append(['AdditionalInputs', additional_inputs]) |
3056 actions_spec.append(action_spec) | 3057 actions_spec.append(action_spec) |
OLD | NEW |