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

Hi, I am creating a script release using NAnt. How can I check the value of a variable, receiving or not.

Now I call my script as follows

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

Several times I will not pass uID.

So I need to check my nant script whether uIDs get or not. How can i do this?

+6
source share
2 answers

There is a property::exists function that you should use:

 <if test="${property::exists('uIDs')}"> <echo message="uIDs is set" /> </if> 
+10
source

Most (or even all?) NAnt tasks have if / except attributes. You can use the :: exists () property in combination with these attributes for the script build condition.

+1
source

Source: https://habr.com/ru/post/895850/


All Articles