Can I make the Ant copy task OS-specific?

后端 未结 6 1691
醉梦人生
醉梦人生 2021-02-07 05:03

I have an Ant script that performs a copy operation using the \'copy\' task. It was written for Windows, and has a hardcoded C:\\ path as the \'todir\' argument. I see the \'exe

6条回答
  •  被撕碎了的回忆
    2021-02-07 05:28

    I would recommend putting the path in a property, then setting the property conditionally based on the current OS.

    
       
    
    
       
    
    
    No foo.path set for this OS!
    

    As a side benefit, once it is in a property you can override it without editing the Ant script.

提交回复
热议问题