It looks like a fileset using the includesfile attribute skips the entries with a relative path starting with "./". Here is an example illustrating the issue, a simple class importing an Ant package is compiled. The elements of the classpath are defined in a 'dependencies' file. The first compilation uses a relative path starting directly with the name of the jar, and the second compilation uses a relative path prefixed by "./". The first compilation works but the second one fails: <?xml version="1.0" encoding="UTF-8"?> <project default="compile"> <target name="compile"> <copy file="${ant.home}/lib/ant.jar" todir="."/> <echo file="Test.java">import org.apache.tools.ant.types.*; public class Test {}</echo> <echo file="dependencies">ant.jar</echo> <javac srcdir="." destdir="." includeantruntime="false"> <classpath> <fileset dir="." includesfile="dependencies"/> </classpath> </javac> <delete file="Test.class"/> <echo file="dependencies">./ant.jar</echo> <javac srcdir="." destdir="." includeantruntime="false"> <classpath> <fileset dir="." includesfile="dependencies"/> </classpath> </javac> </target> </project>
For better or worse, this is how patterns work in Ant. <target name="compile2"> <copy file="${ant.home}/lib/ant.jar" todir="."/> <echo file="Test.java">import org.apache.tools.ant.types.*; public class Test {}</echo> <javac srcdir="." destdir="." includeantruntime="false"> <classpath> <fileset dir="." includes="ant.jar"/> </classpath> </javac> <delete file="Test.class"/> <javac srcdir="." destdir="." includeantruntime="false"> <classpath> <fileset dir="." includes="./ant.jar"/> </classpath> </javac> </target> will tell you ./ant.jar doesn't match either.
(In reply to Stefan Bodewig from comment #1) > For better or worse, this is how patterns work in Ant. Is it set in stone, or does handling "./" as "" sound like a reasonable suggestion?
>> Is it set in stone, or does handling "./" as "" sound like a reasonable suggestion? I think that could impact backward compatibility. Alternatively, would making a note in the documentation about how it currently behaves, help?