ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: How to?: add target dependencies
Date Thu, 10 Feb 2005 20:01:11 GMT
> From: Mark Lundquist [mailto:mlundquist2@comcast.net]
>
> I've got several "modules" that I need to be able to build into various
> projects.  So what I think I'd like to be able to do is use <macrodef>
> and then be able to just call out the modules like so:
> 
> 	<module name="killer-app" />
> 	<module name="job-security" />
> 	<module name="legacy-crap" />
> 	<!-- etc... -->
> 
> The idea is that this would
> 
> (a) build up a file that I can use to invoke "svn propset svn:externals
> -f", then "svn update" the external 'mount-point' if it doesn't exist
> - i.e., "fetch" the module sources into the local project;
> 
> (b) create a task for each module (e.g., "modules:killer-app") that
> calls <ant> in the module subdirectory and also does some other stuff;

You mean create a target, right!?

> (c) make it so that the task "module" invokes all the module targets.

Again, that would be the "module" target, no!?

> I think I can handle all the ant machinery for (a) and (b); it's just
> (c) that has me flummoxed.
> 
> This kind of thing is a way of life in 'make'... there, you don't even
> think about it.  You can say:
> 
> 	modules:; module.killer-app
> 	modules:; module.legacy-crap

Like you say, this isn't an easy one to answer, but let me try to answer random questions,
and see if any of it is useful...

I 'think' you could replace your (b) and (c) by <subant>. Sounds like (a) creates a
new build file by module, in the main build, and with (b) and (c) you want a way to build
one or all modules from the main build. Am I close?

If (a) creates stand-alone build file, you can build a single module by just using build -f
modules/moduleA/build.xml ... and in the mail build, you can call <subant><fileset
dir="modules" includes="*/build.xml" /></subant>.

I do have up my sleeve a <bm:targetdef> custom task that creates a empty target which
depends on other targets on the fly, but you can't statically depend on such a target, you
must <antcall> it (or <bm:call> or <ac:call> to avoid the cost of creating
another project, but it's dangerous).

With <import>, you should be able to have your module builds pretty small.

Hopefully that was helpful.

> BTW this isn't meant as an ant vs. make thing, I just mention it in the
> hopes that maybe somebody else with a 'make' background will recognize
> what the crap I'm talking about :-) :-).

I think the make analogy was useful ;-) --DD

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


Mime
View raw message