ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <rhi...@sympatico.ca>
Subject Re: Ant Java API Question
Date Tue, 15 Jun 2004 21:30:18 GMT
I think you should be asking this on the Ant *Developer* mailing list, not
the user mailing list ;-)

Rhino

----- Original Message ----- 
From: "Shay" <sthompso@adobe.com>
To: <user@ant.apache.org>
Sent: Tuesday, June 15, 2004 4:41 PM
Subject: Ant Java API Question


>
> I'm having a problem with calling ant scripts from the API and I was
hoping
> someone might know the solution.
>
> Let's say you have 2 ant scripts, A and B.  The main target in A calls a
> target in B.  Now if I use the java API to call A, it should in turn call
> B, but it's not.  Instead, it just returns and I don't see an error or
> anything.
>
> Now if I run via the command line, A will call B.  I can also call B
> directly from the API and then B's target will successfully run.
>
> Am I just missing something when I create my project?  My code is at the
> bottom.
>
> Thanks,
> Shay
>
> final Project project = new Project();
> project.init();
> final BuildLogger logger = new NoBannerLogger();
>
> logger.setMessageOutputLevel(Project.MSG_INFO);
> logger.setOutputPrintStream(System.out);
> logger.setErrorPrintStream(System.err);
> project.addBuildListener(logger);
> Ant aScript = (Ant) project.createTask("ant");
> try {
>          aScript.setDir(new File(inScriptPath));
>          aScript.setAntfile(fBuildScript.getCanonicalPath());
>          aScript.setTarget(inTask);
>          aScript.execute();
>
> } catch (Exception e) {
>          e.printStackTrace();
> }
>
>
>
>
> Give a man a fish, and you feed him for a day.  Tell him he should learn
how
> to fish himself, and he'll hate you for a lifetime.
>
> Shay Thompson - sthompso@adobe.com
> Adobe Systems, Bedrock Team
> Voice: x34728 or 651.766.4728
>


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


Mime
View raw message