How to exclude a directory which is already included in an Ant FileSet? -


I am using the jar function in ant and want to exclude a certain directory . The structure of the directory is something like this:

  food. _ Fruits | _ Apple | _ Banana  

(has been made a bit simpler and simpler)

And I have such an ant function:

  & Lt; Jar destfile = "Dest.jar" & gt; ... & lt; Fileset dir = "food" & gt; & Lt; Leave name = "** / banana" /> & Lt; Leave name = "** / * test *" /> & Lt; Include name = "** / *. Class" /> & Lt; / Fileset & gt; ...  

What I am trying to do is:

  • All that ends in ".class" (this works) Include files
  • Exclude all files that have "test" in their filename (this works)
  • Skip the complete directory named "banana" ( this does not work )

I have tried several wildcards in an effort to exclude the banana directory, it has no advantage. I have also tried to review and include it, although I do not know if I make a difference I have tried some other suggestions [1] [2] I did not have a job. At present my wild guess is that within the banana directory, there are files that match the "* class", so I am thinking that preventing banana from being extinguished is preventing.

NB: I coincides with the real name of the Ken Directory, then case-sensitivity should not be an issue. If this task can be simplified, then I can refer to the directory as a complete path, although I prefer to be a bit more refactor-friendly in ant function.

How can I exclude a directory that is already included in an ant fileset?


[1]
[2]

< P> I have discovered the cause of the problem, and how the ant task was written, there is nothing to do with it.

The problem appears to be what is included in the file and is not included, as well as to determine whether the jar file is actually being created or not. To run the work repeatedly, and always using the same destination for jars, it seems that the created jar file was not in place of the existing jar (as I would have assumed it). The result of the removal of the jar and the replay of the ant task resulted in the results I received.

I do not know that to handle the file, I should feel silent, or if I had the right to feel suffering there was no log message about it, comments welcome Anyhoo, problem solving


Comments