English 中文(简体)
有条件的财产
原标题:conditional property setting
  • 时间:2011-07-01 17:36:00
  •  标签:
  • ant

How can i set a single property to different values based on conditions. My scenario is as follows: 1) Loop through different values of messageid 2) Give different comment for each messageid

   <for list="12,23,34,45" param="messageid">
   <sequential>
      <condition property="comment" value="wireMsg-Inbound">
         <equals arg1="messageid" arg2="12"/>
      </condition>
      <condition property="comment" value="wireMsg-Outbound">
         <equals arg1="messageid" arg2="12"/>
      </condition>     
      <condition property="comment" value="appMsg-Inbound">
         <equals arg1="messageid" arg2="12"/>
      </condition>
      <condition property="comment" value="appMsg-Outbound">
         <equals arg1="messageid" arg2="12"/>
      </condition>
       </sequential>
   </for>

Is this valid? Is there any other way? Also if i want to go through the loop each time the property comment should get updated with the new value, but since properties are immutable, how do i solve this?

增 编

问题回答

rel=“nofollow”>variable mission is mutable. 它位于我看到你已经利用来执行任务的英勇图书馆。





相关问题
i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was ...

Subant targets instead of ant

I m having a problem with subant and have no ideas any more. Can anyone help? Using Ant to replace some strings for other (i.e Productname and Version for "Foo" and "1.2") I used ...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...

热门标签