Open
Description
-getTargetResult
will run a target that otherwise would not run.
E.g. Given a project with targets one
and two
and the targets have no dependency between them:
<Project>
<Target Name="One">
<PropertyGroup>
<First Condition="$(First) == ''">One</First>
</PropertyGroup>
<Message Text="One" />
<Message Text="First = $(First)" />
</Target>
<Target Name="Two">
<PropertyGroup>
<First Condition="$(First) == ''">Two</First>
</PropertyGroup>
<Message Text="Two" />
<Message Text="First = $(First)" />
</Target>
</Project>
and given a command line with -target:one -getTargetResult:two
, both targets will be executed.
The current behavior executes the targets provided to -getTargetResult
that didn't already execute, after the 'standard' target build order. Essentially there is a secondary chain of targets.
It seems from the discussion that this is not the intended behavior.
My own quick take is that -getTargetResult
should not itself cause a target to be executed and if a target provided to -getTargetResult
didn't execute then there is no result to report.
Originally posted by @jrdodds in #3911 (comment)