How can I print a fileset to a file, one file name per line?

Use the PathConvert task: <fileset id=”myfileset” dir=”../sounds”> <include name=”*.wav” /> <include name=”*.ogg” /> </fileset> <pathconvert pathsep=”${line.separator}” property=”sounds” refid=”myfileset”> <!– Add this if you want the path stripped –> <mapper> <flattenmapper /> </mapper> </pathconvert> <echo file=”sounds.txt”>${sounds}</echo>

Getting Ant to recognise a classpath

Here’s an example from a project I am currently working on. I suspect you can modify it to work for your situation. <path id=”master-classpath”> <fileset dir=”${web.dir}/WEB-INF/lib”> <include name=”*.jar”/> </fileset> <fileset dir=”${appserver.lib}”> <include name=”servlet*.jar”/> </fileset> <pathelement path=”${build.dir}”/> </path> … <javac destdir=”${build.dir}”> <src path=”${src.dir}”/> <classpath refid=”master-classpath”/> </javac>

good ivy tutorial for local repository? [closed]

Creating a local ivy repository is straight forward, maven is not required. Here’s an example of publishing some text files using ivy as a standalone program. I have 3 files I want to publish: src/English.txt src/Spanish.txt src/Irish.txt The ivy file src/ivy.xml details the name of the module and a list of the artifacts being published. … Read more

How do I pass an argument to an Ant task?

One solution might be as follows. (I have a project that does this.) Have a separate target similar to test with a fileset that restricts the test to one class only. Then pass the name of that class using -D at the ant command line: ant -Dtest.module=MyClassUnderTest single_test In the build.xml (highly reduced): <target name=”single_test” … Read more

Using ant to detect os and set property

Move your condition out of the <target />, as your target probably isn’t invoked. <condition property=”isWindows”> <os family=”windows” /> </condition> <condition property=”isLinux”> <os family=”unix” /> </condition>