ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Baer <jonb...@digitalanywhere.com>
Subject Re: Embedding ANT into a project...
Date Wed, 20 Jun 2001 12:29:14 GMT
Thanks, sounds a little like what I need to do.

Basically though what Id like to do is feed in a dynamic XML string vs. a
Build.xml file (the string is embedded inside another XML language), as
such:

<ant>
ant code here
</ant>

- Jon

Don Taylor wrote:

> Depends on what you mean by "embedding". In my application I've
> "embedded" Ant as follows:
>
> 1.) Copy org.apache.tools.ant.Main.java into your project. RENAME THIS
> CLASS.
>
> 2.) Make runBuild() have either public or package access, depending on
> what you need.
>
> 3.) Comment-out project.fireBuildStarted() and
> project.fireBuildFinished() from runBuild(). Now I can't remember why I
> had to do that!
>
> 4.) Of course ensure the usual Ant jars are in your classpath.
>
> Then I just pass in all the usual Ant parameters to Main(). This works
> for me because I'm using an external "build" file. I think you're going
> to have to do a little more since you're effectively wanting to hand
> Ant a subset of a file. Just glancing at the code, I'd look into the
> line ProjectHelper.configureProject(...) in runBuild().
>
> --- Jon Baer <jonbaer@digitalanywhere.com> wrote:
> > Im just curious, Im about to write an AntProcessor for a natural
> > language
> > project Im working on (www.alicebot.net).  The way it works is
> > something like:
> >
> > <pattern>BUILD THE ALICEBOT</pattern>
> > <template>
> >     <ant>
> >     <!-- ant target here -->
> >     </ant>
> > </template>
> >
> > I know, rather wierd but I figured since we are using Ant anyway that
> > it would
> > be cool to process some tasks under there.  Has anyone embedded it
> > before?
> >
> > - Jon
> >
>
> =====
> Don
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


Mime
View raw message