Nam G VU
Nam G VU

Reputation: 35374

How to run a target only it hasn't run?

I have a NAnt script like below:

<target name="Init" unless="${target::has-executed('Init')}">

What I want is to convert it into MSBuild script. What I can't do is to write MSBuild script to run a target only when it hasn't run like the above script.

Please help.

Upvotes: 1

Views: 261

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239664

Targets only run once in an MSBUild build process. So just have a CallTarget element, and if it's already run, it will be skipped.

Upvotes: 3

Related Questions