ant runs Ant using the build.xml file in the current directory, on the default target.
ant -buildfile test.xml runs Ant using the test.xml file in the current directory, on the default target.
ant -buildfile test.xml dist runs Ant using the test.xml file in the current directory, on the target called dist.
ant -buildfile test.xml -Dbuild=build/classes dist runs Ant using the test.xml file in the current directory, on the target called dist, setting the build property to the value build/classes.