简体   繁体   中英

Delete files from a folder based on an existing set of files in another folder

This one I couldn't find a proper answer.

I have 2 folders. One is called 'src', where my java source code is located. The other one is called 'srcGenerated' and has a set of files created by a code generator. srcGenerated is a superset of src.

I want to use both folders as my build path on Eclipse. The problem is the duplicated files in srcGenerated. Since there is no way to supress the generation of files that are already in src, my question is, how to delete the duplicated files in srcGenerated based on the existing set of files from src.

Ant or Powershell script preferred.

May not be the easiest one, but this is what I though of.

You can exclude Java files from srcGenerated that you don't want to be included while building.

右键单击项目,Java构建路径

Here you can exclude all the files that you don't want to be built. I know, it's painstaking if there are hundreds of conflicting Java files. But it definitely works.

设置排除模式

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM