How can I put several folders individually with ant?

If I have a folder with several subfolders (e.g. foo, bar, baz), how can I use ant to individually change them in foo.zip, bar.zip and baz.zip without doing them one at a time

Ideally, there should also be a way to specify files / subfolders for zip, rather than "every one".

+3
source share
2 answers

You do not want to use ant -contrib. ant -contrib sucks, every time you use it, you get technical debt. One thing to keep in mind when using ant: let ant be ant. ant is what it is. he is declarative. The original intention of ant was a simple declaration of properties and with the meat of the work being done in java (where you had a real IDE with debugger and test environments). As noted in ant style elements - "Let ant be ant". If you need to use ant -contrib, you must create your own ant task. If you cannot do this, do not use ant. ant -contrib takes the worst of ant ant, makes it worse, you will soon find things unthinkable. Enough to rant.

, ... /tmp . .

    <mapper id="zip" type="glob"
    from="*"
    to="*.zip"/>

<target name="zip-craziness">
    <apply executable="zip">
        <targetfile/>
        <srcfile/>
        <dirset dir="/tmp" />
         <mapper refid="zip"/>
    </apply>
</target>
+4
0

All Articles