ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Stringer <>
Subject Re: How to add mutable content to immutable build file
Date Sat, 17 Jun 2006 10:52:07 GMT
On Fri, 2006-06-16 at 18:54 +0300, Vitaliy S wrote:
> Hello,
> I have target with a task supporting subtasks
> e.g
>  <copy todir="../dest/dir">
>    <!--begin of mutable content -->
>     <fileset dir="src_dir">
>       <exclude name="**/*.java"/>
>     </fileset>
>    <!--end of mutable content -->
>   </copy>
> the content of task may be changed but the rest file is immutable.
> I want to store mutable content in  seporate file.
> What is the best way to do it?

Hi Vitaliy,

I'm not sure I understand your requirement, but if you are saying that
the XML describing the task will change from build to build, and you
need to use it, then I'd suggest using <import> to import the mutable
part of the task, then having the immutable part of the task call the
mutable part using <antcall>.



<project name="mutable" basedir=".">
  <target name="mutable.part">
    <echo>I change from build to build</echo>


<project name="build" basedir=".">
  <import file="mutable.xml"/>
  <target name="immutable.part">
    <echo>I never change from build to build</echo>
    <antcall target="mutable.part"/>
    <echo>I also never change</echo>

If the mutable part changes _during_ build time, this gets trickier,
although it still should be possible to get working, by using the <ant>
task to re-import the mutable file. 

But not fully understanding what you are after, I may be way off here :)

Cheers, Ben

> Regards,
> Vitaliy S
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message