Is it possible to replace text in properties in Ant's build.xml?

前端 未结 5 1964
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 15:41

I have a property, app.version, which is set to 1.2.0 (and, of course, always changing) and need to create zip file with name \"something-ver-1_2_0\". Is this possible?

5条回答
  •  我在风中等你
    2021-01-06 16:26

    Properties can't be changed but antContrib vars (http://ant-contrib.sourceforge.net/tasks/tasks/variable_task.html ) can.

    Here is a macro to do a find/replace all on a var:

        
            
            
            
            
                
                
                
                
                
                
                
    
                
                
            
        
    

    Then call the macro like:

    
    
    Filename will be ${newFileName}
    

提交回复
热议问题