You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michael Giroux <ml...@gmail.com> on 2006/07/24 22:32:15 UTC

for refid

Currently, <modified> is not supported for refid.  I would like to
suggest that this is a needed feature.

I have a project that must be built on several platforms.  The
build.xml uses scp to copy the files to each target system, then
sshexec to execute the build script.

The files are the same on all systems, so I define a single fileset,
and reference the fileset via refid in each of the scp tasks.

I would like to use <modified> selector to limit the files that are
transferred, but there is no way to do this given my use of referenced
filesets.  I cannot include the selector in the fileset itself since
the cache will be updated on the first reference, and subsequently no
transfers will occur for other target systems.

What I need to do is specify a separate cache for each target
platform.  The only way to do that with current ANT 1.6.5 is to
duplicate the fileset in every <scp> task.

I will look into creating a macro for this, and I'm sure that will
work, but it seems reasonable to allow the modified selector in a
fileset that uses a refid as well.

Michael Giroux

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


Re: for refid

Posted by Michael Giroux <ml...@gmail.com>.
Dominique,

On 7/25/06, Dominique Devienne <dd...@gmail.com> wrote:

> Which is what I suggested yesterday. A little longer, but not that
> much, and just one extra property for the dir. --DD

Sorry, I did not understand what you were suggesting.  The example
really helps.  Thanks.
Michael

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


Re: for refid

Posted by Dominique Devienne <dd...@gmail.com>.
Right. All (normal) Ant types do not accept any attributes or nested
elements when refid is used. But you can almost do it using:

<fileset dir="${dir}">
  <patternset refid="the file patterns" />
  <modified />
</fileset>

Which is what I suggested yesterday. A little longer, but not that
much, and just one extra property for the dir. --DD

On 7/25/06, Michael Giroux <ml...@gmail.com> wrote:
> Dominique,
>
> On 7/24/06, Dominique Devienne <dd...@gmail.com> wrote:
> > <modified> is a selector, and thus will never have a refid attribute.
>
> I'm not suggesting that <modified> accept a refid attribute.  What I'm
> saying is that a fileset with a refid cannot contain a selector.
>
> <fileset refid="common.files">
>  <modified .../>
> </fileset>
>
> This form is not allowed.  In fact, I have a set of files common to
> several target systems, and I need to copy modified files to each
> system.  To accomplish this, I have to be able to specify a different
> cache for each <scp> command.
>
> HTH.
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Re: for refid

Posted by Michael Giroux <ml...@gmail.com>.
Dominique,

On 7/24/06, Dominique Devienne <dd...@gmail.com> wrote:
> <modified> is a selector, and thus will never have a refid attribute.

I'm not suggesting that <modified> accept a refid attribute.  What I'm
saying is that a fileset with a refid cannot contain a selector.

<fileset refid="common.files">
  <modified .../>
</fileset>

This form is not allowed.  In fact, I have a set of files common to
several target systems, and I need to copy modified files to each
system.  To accomplish this, I have to be able to specify a different
cache for each <scp> command.

HTH.
Michael

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


Re: for refid

Posted by Dominique Devienne <dd...@gmail.com>.
<modified> is a selector, and thus will never have a refid attribute.
It only sees one file at a file, and decides whether this file should
be selected or not.

Selectors always end up being *nested* in a fileset. Each of your
<scp> needs to get a different filesets, corresponding to the files
than need transfering on that particular system. You might think of
the total set of files to be transfered (irrelevant of up-to-date
check) to be your fileset, but it's not, not really.

That said, you should still be able to do what you want by defining a
<patternset> with an id, and each fileset references this one
patternset, and has it's own <modified> with a system-specific
propertyfile cache. Note that this stategy assumes no one changes the
files directly on the system (in which case the cache is out-of-date).

Using a macro around <scp> and the fileset + modified doesn't even
require to explicitly declare a <patternset>, and is probably a better
idea anyway. --DD

On 7/24/06, Michael Giroux <ml...@gmail.com> wrote:
> Currently, <modified> is not supported for refid.  I would like to
> suggest that this is a needed feature.
>
> I have a project that must be built on several platforms.  The
> build.xml uses scp to copy the files to each target system, then
> sshexec to execute the build script.
>
> The files are the same on all systems, so I define a single fileset,
> and reference the fileset via refid in each of the scp tasks.
>
> I would like to use <modified> selector to limit the files that are
> transferred, but there is no way to do this given my use of referenced
> filesets.  I cannot include the selector in the fileset itself since
> the cache will be updated on the first reference, and subsequently no
> transfers will occur for other target systems.
>
> What I need to do is specify a separate cache for each target
> platform.  The only way to do that with current ANT 1.6.5 is to
> duplicate the fileset in every <scp> task.
>
> I will look into creating a macro for this, and I'm sure that will
> work, but it seems reasonable to allow the modified selector in a
> fileset that uses a refid as well.
>
> Michael Giroux
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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