Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
API: Building up a project object from a build.xml file

API: Building up a project object from a build.xml file

2003-03-28       - By Oliver Alth

Hello,

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();
project.init();
helper.configureProject(project,configFile);

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">
</exec>
</target>

Thanks in advance for your help,

OIiver





__


________________________________________________________________
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
Internet: OALTH@(protected)



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.