Ant check existence for a set of files

前端 未结 3 471
难免孤独
难免孤独 2020-12-09 18:30

In ant, how can i check if a set of files (comma-separated list of paths) exist or not?

For example I need to check if all paths listed in myprop exist

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 18:45

    Bundled conditions are the shortest solution to check for existence of multiple dirs or files :

    
     
      
      
      
      ...
     
    
    

    To check for a commaseparated list of path use Ant addon Flaka , f.e. :

    
    
     
     
      
        
                     
    
    

    Another possibility is the use of scriptcondition task with a jvm scripting language like groovy,beanshell .. etc.

提交回复
热议问题