How to pull out a substring in Ant

前端 未结 6 1116
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 16:31

Is there a way to pull a substring from an Ant property and place that substring into it\'s own property?

6条回答
  •  爱一瞬间的悲伤
    2020-12-03 17:27

    i would use script task for that purpose, i prefer ruby, example cut off the first 3 chars =

    
        
        
        
        $${mystring} == ${mystring}
           
      
    

    output =

    main:
         [echo] ${mystring} == barfoobaz
    

    using the ant api with method project.setProperty() on an existing property will overwrite it, that way you can work around standard ant behaviour, means properties once set are immutable

提交回复
热议问题