문제

Is it possible to ignore a target in a proj file? Anything of the sort of

msbuild amazingproject.proj /IgnoreTarget:TimeConsumingTarget

or can we set a condition value for the target while calling msbuild?

msbuild amazingproject.proj /Variable:TimeConsumingCondition=False

& in the proj file we can have

<targed name="TimeConsumingTarget" Condition="$(Variable:TimeConsumingCondition)"=="True">

Any other suggestion that works?

The whole story: We have many developers, some of whom need this target to run and some don't. So we need a conditional call for the target.

도움이 되었습니까?

해결책

Just look at the documentation of Target.

Project:

<Target Name="TimeConsumingTarget"
        Condition="'$(BuildTimeConsumingTarget)'=='True'">

Invoked like:

msbuild amazingproject.proj /p:BuildTimeConsumingTarget=false
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top