I have to add many jar files to a "javac" and a "junit" task from command line arguments. The
Ant script:
<javac srcdir="${test.dir}"
destdir="\({test.class.dir}"
encoding="UTF-8"
debug="true"
failonerror="true">
<classpath>
<pathelement location="\)"/>
The corresponding command line is:
ant -Dpdegen.classpath=/path/to/jar1:/path/to/jar2 target_name
Here is the working Python script:
from subprocess import call
test_cmd = 'ant -buildfile unittest.xml -Drootdir='+ base_dir + \
pkg_name +' -Dcobertura.path=/usr/share/ant/lib/cobertura.jar -Dpdegen.classpath='+classpath[pkg_name]
ret = call(test_cmd.split())