ant-contrib - if/then/else task

后端 未结 5 969
暗喜
暗喜 2020-12-28 19:40

I am using ant, and I have a problem with if/then/else task, (ant-contrib-1.0b3.jar). I am running something that can be simplified with build.xml below.

I am ex

5条回答
  •  太阳男子
    2020-12-28 20:14

    I know this is old, but should prove handy to others searching for a solution.

    to re-assign a property without using ant-contrib, use macrodef with a script.

     
        
        
         
            
         
      
    

    then in anywhere in ant, just call this like the property tag

    
    

    to Implement this in your original version of xml, it would look like this:

    
    
    
    
        
            
        
    
    
    
    
    
        
        
        
        
            
        
    
    
    
    
    

    This sample is given purely as an example on writing a macro to replace the command in ant-contrib. In a situation like this one, where the command is being used, it makes more sense to use sinnce ant-contrib is already loaded, and might be faster in processing.

    Hope this helps.

提交回复
热议问题