I want to execute an antscript from java program with arguments, example: ant -f myantscript.xml -dir \my\path\dir .I am able to run without arguments like this
File buildFile = new File("build.xml");
Project p = new Project();
p.setUserProperty("ant.xml", buildFile.getAbsolutePath());
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.executeTarget(p.getDefaultTarget());
which function can i use to set arguments ?