Found it on the manual!
"Defining properties on the command line can also be used to pass in the value of environment variables - just pass -DMYVAR=%MYVAR% (Windows) or -DMYVAR=$MYVAR (Unix) to
Ant. You can then access these variables inside your build file as ${MYVAR}. "
Thanks