Reputation: 181
I'm looking to use Ant to build a project, everything into a .zip file.
Ant's Zip task has an excludefiles attribute - but I was looking for functionality more similar to the .gitignore file in that it collects more excludes as it is copying from subdirectories.
For example, if I had the following structure
toBuild
|--a
| |--.ignores
| |--File1.txt
| |--File2.txt
| +--File3.txt
|--b
| |--.ignores
| |--File1.txt
| |--File2.txt
| +--File3.txt
|--.ignores
|--File1.txt
|--File2.txt
+--File3.txt
With:
Then the output would be
builtZip
|--a
| +--File2.txt
|--b
| +--File1.txt
|--File1.txt
+--File2.txt
What would be the best approach to something similar to this?
Upvotes: 0
Views: 72
Reputation:
Sounds like a good use case for custom selectors:
http://ant.apache.org/manual/Types/selectors.html#customselect
You'll probably need to write your own selector as explained here:
http://ant.apache.org/manual/Types/selectors-program.html
Upvotes: 1