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

前端 未结 5 1962
没有蜡笔的小新
没有蜡笔的小新 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:29

    You can use the pathconvert task to replace "." with "_" and assign to a new property:

    
    
        
    
        
            
    
            
            
    
            
                     
            
    
        
    
        ${app.version} converted to ${app.version.underscore}
    
    

提交回复
热议问题