开发者

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

开发者 https://www.devze.com 2023-03-31 04:28 出处:网络
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

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


    n开发者_JAVA技巧ant -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?


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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消