如何从Ant文件集中排除文件列表(保存在文件中)?

时间:2021-02-19 15:01:38

Is there a way to have an Ant Fileset->IncludesFile attribute take a property file OR any other file that contains a list of Java class files to exclude?

有没有办法让Ant Fileset-> IncludesFile属性获取属性文件或包含要排除的Java类文件列表的任何其他文件?

Eg:

File A.properties OR A.java contains listing

文件A.properties OR A.java包含列表

abc.class 
mno.class 
xyz.class 

Is there a way to say to point excludesFile to file A.properties.

有没有办法说出将excludesFile指向文件A.properties。

<fileset dir="...">
    <excludesFile file="A.properties" />
</fileset>

The behavior that I want is when Java runs, it excludes the Java files listed in this file (A.properties)

我想要的行为是Java运行时,它排除了此文件中列出的Java文件(A.properties)

1 个解决方案

#1


Hmm...not sure if it's case sensitive. The documentation at http://ant.apache.org/manual/Types/fileset.html shows "excludesfile", all lowercase, as with other ant directives.

嗯......不确定它是否区分大小写。 http://ant.apache.org/manual/Types/fileset.html上的文档显示“excludesfile”,全部小写,与其他ant指令一样。

I'm not sure exactly what you are asking. If you have a fileset which is including files you would like to exclude, and you want to specify that list of files to exclude in an external file, "excludesfile" is the correct way to do it.

我不确定你在问什么。如果您的文件集包含要排除的文件,并且要指定要在外部文件中排除的文件列表,则“excludesfile”是执行此操作的正确方法。

#1


Hmm...not sure if it's case sensitive. The documentation at http://ant.apache.org/manual/Types/fileset.html shows "excludesfile", all lowercase, as with other ant directives.

嗯......不确定它是否区分大小写。 http://ant.apache.org/manual/Types/fileset.html上的文档显示“excludesfile”,全部小写,与其他ant指令一样。

I'm not sure exactly what you are asking. If you have a fileset which is including files you would like to exclude, and you want to specify that list of files to exclude in an external file, "excludesfile" is the correct way to do it.

我不确定你在问什么。如果您的文件集包含要排除的文件,并且要指定要在外部文件中排除的文件列表,则“excludesfile”是执行此操作的正确方法。