ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Alth" <>
Subject API: Building up a project object from a build.xml file
Date Fri, 28 Mar 2003 09:18:06 GMT

I am trying to build up a project object from a build.xml file
with all of its contents.

The problem I have is that when I try to get all tasks from a target, I get
an array
of tasks. But all of the information is gone, like the dir Attribute of an
exec task is null.

What am I doing wrong?

Here's my code:

this.project = new Project();
 this.helper = new ProjectHelper();

 Hashtable h = project.getTargets();

 Enumeration en = h.elements();

 Task[] tasks;

 while (en.hasMoreElements())
      Target t = (Target)en.nextElement();
      tasks = t.getTasks(); // When you look at those tasks, most of their
attributes are null

This is a part of the build.xml file:

<property name="rexx.dir" value="tools/rexx"/>
<property name="edit.dir" value=""/>

<!-- Regedit Builtin Type -->
<target name="regedit">
<exec executable="regedit" dir="${edit.dir}" vmlauncher="false">

Thanks in advance for your help,



IBM Deutschland Entwicklung GmbH, Schönaicher Str. 220, D-71032 Böblingen
eServer Software Management, D4357, Intern: 7103-06, Tel. 902-2790,
Tel.: ++49-(0)7031-16-4280, Fax.: 07031-16-2790

View raw message