Here is a brief example. The build file cool-build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="FunProject" default="work" basedir=".">
<target name="work">
<echo message="my.cool.property=${my.cool.property}">
</target>
</project>
We, run it with passed system property my.cool.property:
ant -f cool-build.xml -Dmy.cool.property=1
And the result is:
[echo] my.cool.property=1
Just as expected :)