Ant check existence for a set of files

前端 未结 3 465
难免孤独
难免孤独 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:57

    This can be solved with the set operations of Ant´s resource collections. If you calculate the intersection of the list of required files with the list of existing files it must not differ from the list of required files. This shows how to do it:

    
    
    
      
        
          
            
              
              
            
            
          
        
      
    
    
    
      
    
    

    The check target reports the list of missing files only if a file is missing.

提交回复
热议问题