От: | Arsen.Shnurkov | ||
Дата: | 04.07.20 04:40 | ||
Оценка: |
The Exec task calls cmd.exe instead of directly invoking a process.
public class ILAsm : ToolTask
От: | Qbit86 | https://twitter.com/qbit86 | |
Дата: | 04.07.20 08:26 | ||
Оценка: |
ExitCode... Specifies the exit code that is provided by the executed command
<Output TaskParameter="ExitCode" PropertyName="_ILAsmExitCode" />
^^^^^^^^^^^^^^
<Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" />
^^^^^^^^^^^^^^^^^^^^^^^^^^
Stops a build and logs an error based on an evaluated conditional statement.
— https://docs.microsoft.com/en-us/visualstudio/msbuild/error-task?view=vs-2019
<Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" />
'$(_ILAsmExitCode)' != '0'
От: | Arsen.Shnurkov | ||
Дата: | 04.07.20 09:12 | ||
Оценка: |
except that if the task logged any errors, but the process had an exit code of 0 (success), ExitCode is set to -1.
(там же на этой же странице написано)task returns false if the executed command returns a non-zero exit code.
Это вот тут написано — https://docs.microsoft.com/en-us/visualstudio/msbuild/task-element-msbuild?view=vs-2019При сбое задачи остальные задачи в элементе Target и сборке не выполняются, и считается, что возник сбой всего элемента Target и всей сборки.
От: | Arsen.Shnurkov | ||
Дата: | 10.07.20 10:16 | ||
Оценка: |
Custom tasks that wrap up executables have many advantages to simply using
the Exec task. Some of those benefits are outlined in the following list:
— Ease of use Since custom tasks have specific properties for inputs and outputs, they
are very easy to use.
— Better input validation You can write .NET code to validate the parameters that the
script is requesting be sent to the executable.
— Easier path resolution Sometimes you may not know where the .exe file resides. You
may have to search the registry or examine a set of folders. This is typically performed
more easily in code than in an MSBuild script.
— Pre- and post-processing Because you are creating a custom task, you can perform
actions before and/or after the execution of the executable.
— Parsing stdout and stderr The ToolTask class can detect errors and warnings from
messages that are sent into the stdout and stderr streams.
— Enables task execution skipping By overriding the SkipTaskExecution method, you can
programmatically determine if the task should be skipped.
От: | Qbit86 | https://twitter.com/qbit86 | |
Дата: | 10.07.20 10:25 | ||
Оценка: |