Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从src中排除src\main和src\test文件
FileCollection files = project.fileTree(/src/).minus(project.fileTree(/src\main/)).minus(project.fileTree(/src\test/))
如何在不使用双重减号的情况下排除此目录?
从 a 中排除子目录的惯用方法FileTree是:
FileTree
def files = fileTree("src").matching { exclude "main", "test" // relative to the file tree's root directory }
PS:代替.minus,您可以使用-。
.minus
-