ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: import requires support in ProjectHelper
Date Thu, 07 Feb 2008 17:36:39 GMT
On Feb 7, 2008 6:13 PM, jm <jmuguruza@gmail.com> wrote:

> HI,
>
> I am using a build file from java code like this (ant 1.7, jdk1.6):
>
>        Project project = new Project();
>        project.init();
>        ProjectHelper projectHelper = ProjectHelper.getProjectHelper();
>        projectHelper.parse(project, buildfile);
>        project.executeTarget(target);
>
> with a simpler build file it is working fine, with one that uses
> imports, I get this buildexcpetion:
>
> build.xml:4: import requires support in ProjectHelper
>
> any idea?

The import task requires a reference of ProjectHelper to be available in the
Project. This is done automatically by using
ProjectHelper.configureProject(Project
project, File buildFile) like this for instance:
       Project project = new Project();
       project.init();
       ProjectHelper.configureProject(project, buildfile);
       project.executeTarget(target);

Xavier

>
>
> thanks
> javier
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message