Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check in NAnt script whether property is set or not?

Hi I am create a release script using NAnt. How can I check a variable value is getting or not.

Now I call my script like this


    nant -buildfile:CreateNew.build -D:name="Test.V.1.0" -D:bIDs="2" -D:uIDs="'3'" 

Some times I will not pass uIDs.

So I need to check in my nant script whether the uIDs is getting or not. How can I do that?

like image 709
learner Avatar asked Aug 25 '11 10:08

learner


2 Answers

There's a property::exists function that you should use:

<if test="${property::exists('uIDs')}">
  <echo message="uIDs is set" />
</if>
like image 150
skolima Avatar answered Oct 18 '22 13:10

skolima


Most (or even all?) NAnt tasks have if/unless attributes. You can use property::exists() function in conjunction with those attributes to condition your build script.

like image 1
Yan Sklyarenko Avatar answered Oct 18 '22 14:10

Yan Sklyarenko