Is there any way to generate a guid in ANT?

前端 未结 2 610
醉酒成梦
醉酒成梦 2021-02-07 11:09

I have an ant script to manage out build process. For WiX I need to produce a new guid when we produce a new version of the installer. Anyone have any idea how to do this in ANT

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 11:35

    I'd use a scriptdef task to define simple javascript task that wraps the Java UUID class, something like this:

    
        
        
    
    
    
    
    

    Result:

    [echo] 42dada5a-3c5d-4ace-9315-3df416b31084
    

    If you have a reasonably up-to-date Ant install, this should work out of the box.

提交回复
热议问题