ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: article: combining make and ant
Date Thu, 21 Mar 2002 14:31:08 GMT
On Fri, 22 Mar 2002 01:19, stephan beal wrote:
> On Thursday 21 March 2002 15:02 pm, you wrote:
> > > No, i'm saying it's more work to do in ant. Also, we MUST (in my case)
> > > run ant multiple times, because of the dependency on not-yet-built
> > > custom tasks. Ant *cannot* load our build.xml unless these tasks exist
> > > and are in the classpath before ant starts. Without some sort of
> > > front-end (make, batch file, whatever), the developer has to run ant
> > > twice. Make fills this gap for us.
> >
> > Are you sure ? I have had no probelm of detecting tasks are not built,
> > rebuilding them, taskdefing them and then continuing with the build - all
> > inside the ant file?
> > What in particular makes you think you need to restart ant?
>
> It may have to do with the order of my <taskdefs> in build.xml, then?
> Certainly conceivable. Here's what i see if i run ant without our custom
> tasks in the classpath (i.e., they aren't built yet):
>
> build@poe:~/cvs/int > ant -buildfile build.stephan.xml
> Buildfile: build.stephan.xml
>
> BUILD FAILED
>
> /home/build/cvs/int/build.stephan.xml:16: taskdef class
> de.einsurance.ant.CVSUpdateTask cannot be found
>
> Fair enough - this is what i would expect. The solution, then, would be to
> build it from a separate process (one which doesn't use <taskdef>s to those
> classes).

What I am saying is that you could instead do this all in your buildfile. 
Something like

<target name="check-mytask">
  <available property="mytask.present" classname="..." classpath="..."/>
</target>

<target name="compile-mytask" depends="check-mytask" unless="mytask.present">
   <javac/>
</target>

<target name="prepare" depends="compile-mytask">
   <taskdef name="mytask" classname="..." classpath="..."/>
</target>

<target name="real-target" depends="prepare">
   <mytask/>
</target>

> > And theres also bucketloads of things that make does far better than ant
> > - Ants still relatively young but we are getting there ;)
>
> No complaints from me, certainly :). i've been having a great time playing
> with it the past week. i won't start using it for my C++ work (can't build
> shared libs in a cross-platform way using ant ;), but i certainly won't use
> make (alone) for any more of my Java work.

Theres actually work going on atm in ant-contrib over at sourceforge. I 
believe they have VCC and GCC partially done ;)

-- 
Cheers,

Pete

*------------------------------------------------------*
| "Common sense is the collection of prejudices        |
|  acquired by age 18. " -Albert Einstein              |
*------------------------------------------------------*

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message