You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ivar Bratberg <Iv...@fast.no> on 2008/08/06 11:37:01 UTC

fileset manipulation

If I have fileset A:

<fileset dir='.' >
<include name="a" />
</fileset>

Is it possible to get the following fileset by a command that takes
fileset A as an argument in ?

<fileset dir='.' >
<include name="a.extension" />
</fileset>

Best regards
Ivar

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


Re: fileset manipulation

Posted by Florijan Stamenkovic <fl...@mac.com>.
Oh... Nope, they are arbitrary project names.

F

On Aug 07, 2008, at 14:04, Matt Benson wrote:

> My point was that I assume that the names of Foo and
> its siblings follow no predictable pattern, hence your
> reason for enumerating them in a file.


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


Re: fileset manipulation

Posted by Matt Benson <gu...@yahoo.com>.
--- Florijan Stamenkovic <fl...@mac.com> wrote:

> 
> On Aug 06, 2008, at 11:35, Matt Benson wrote:
> 
> > To answer your original query, F, for the time
> being I
> > would probably load your includesfile using
> <loadfile>
> > with a nested filterchain and thereby customize
> your
> > basic includesfile for each occasion.
> 
> Huh, I can't find something to append text at the
> end of a line (the  
> opposite of PrefixLines) in the documentation (link
> below). Am I  
> missing something obvious? I guess that token filter
> + ReplaceRegex  
> should do the trick though.
> 

Guess so.  It probably would make sense to complement
PrefixLines with SuffixLines.

>
http://ant.apache.org/manual/CoreTypes/filterchain.html
> 
> Thanks for pointing it out though, I missed this as
> an option.
> 
> > I'm assuming
> > that you've already determined that the
> subdirectories
> > enumerated in that basic file follow no
> generalizable
> > pattern.
> 
> I am not sure that I understand your point. The
> structure of the  
> subdirectories declared in the includes file is
> predictable. It is  
> just that I require different things from it, at
> different times. For  
> example, for a given Foo folder, at one point I need
> to get Foo/dist/ 
> Foo.framework/**/*.* and at other times I need
> Foo/build.xml
> Is that what you're asking?
> 

My point was that I assume that the names of Foo and
its siblings follow no predictable pattern, hence your
reason for enumerating them in a file.

-Matt

> F
> 
>
---------------------------------------------------------------------
> 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: fileset manipulation

Posted by Florijan Stamenkovic <fl...@mac.com>.
On Aug 06, 2008, at 11:35, Matt Benson wrote:

> To answer your original query, F, for the time being I
> would probably load your includesfile using <loadfile>
> with a nested filterchain and thereby customize your
> basic includesfile for each occasion.

Huh, I can't find something to append text at the end of a line (the  
opposite of PrefixLines) in the documentation (link below). Am I  
missing something obvious? I guess that token filter + ReplaceRegex  
should do the trick though.

http://ant.apache.org/manual/CoreTypes/filterchain.html

Thanks for pointing it out though, I missed this as an option.

> I'm assuming
> that you've already determined that the subdirectories
> enumerated in that basic file follow no generalizable
> pattern.

I am not sure that I understand your point. The structure of the  
subdirectories declared in the includes file is predictable. It is  
just that I require different things from it, at different times. For  
example, for a given Foo folder, at one point I need to get Foo/dist/ 
Foo.framework/**/*.* and at other times I need Foo/build.xml
Is that what you're asking?

F

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


Re: fileset manipulation

Posted by Matt Benson <gu...@yahoo.com>.
--- Florijan Stamenkovic <fl...@mac.com> wrote:

> Ivar,
> 
> 
> I think your problem is similar to the one I
> described a few days ago  
> in:
> 
>
http://mail-archives.apache.org/mod_mbox/ant-user/200808.mbox/%
> 
> 3c063B99A8-B9FC-4011-8AC3-6519568D6516@mac.com%3e

Maybe so; I honestly can't tell what Ivar is after.

> 
> So far I have not been able to solve it, nor
> received any answers. I  
> guess that the answer is that it can not be done
> using standard ant  
> stuff, that we may need to write custom tasks to do
> this work.
> 

To answer your original query, F, for the time being I
would probably load your includesfile using <loadfile>
with a nested filterchain and thereby customize your
basic includesfile for each occasion.  I'm assuming
that you've already determined that the subdirectories
enumerated in that basic file follow no generalizable
pattern.

HTH,
Matt

> F
> 
> On Aug 06, 2008, at 05:37, Ivar Bratberg wrote:
> 
> > If I have fileset A:
> >
> > <fileset dir='.' >
> > <include name="a" />
> > </fileset>
> >
> > Is it possible to get the following fileset by a
> command that takes
> > fileset A as an argument in ?
> >
> > <fileset dir='.' >
> > <include name="a.extension" />
> > </fileset>
> >
> > Best regards
> > Ivar
> >
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



      

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


Re: fileset manipulation

Posted by Florijan Stamenkovic <fl...@mac.com>.
Ivar,


I think your problem is similar to the one I described a few days ago  
in:

http://mail-archives.apache.org/mod_mbox/ant-user/200808.mbox/% 
3c063B99A8-B9FC-4011-8AC3-6519568D6516@mac.com%3e

So far I have not been able to solve it, nor received any answers. I  
guess that the answer is that it can not be done using standard ant  
stuff, that we may need to write custom tasks to do this work.

F

On Aug 06, 2008, at 05:37, Ivar Bratberg wrote:

> If I have fileset A:
>
> <fileset dir='.' >
> <include name="a" />
> </fileset>
>
> Is it possible to get the following fileset by a command that takes
> fileset A as an argument in ?
>
> <fileset dir='.' >
> <include name="a.extension" />
> </fileset>
>
> Best regards
> Ivar
>
> ---------------------------------------------------------------------
> 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: fileset manipulation

Posted by Matt Benson <gu...@yahoo.com>.
--- EJ Ciramella <ej...@upromise.com> wrote:

> If this is a custom task/macro, couldn't you just
> programmatically
> generate that secondary fileset?

That is possible.  It would probably also be doable to
create a new includes pattern using <pathconvert> and
a file mapper and generate the new fileset
"Ant-ically" as well.

-Matt

> 
> This is out there on the fringe of my ant knowledge,
> so it's plausible
> you could do this within ant (with a refid or some
> other kind of
> reference back to the original fileset), but I can't
> say for sure and
> nothing pops out in the documentation.
> 
> -----Original Message-----
> From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
> Sent: Thursday, August 07, 2008 3:33 AM
> To: Ant Users List
> Subject: RE: fileset manipulation
> 
> Ok, to be more precise:
> I have defined an ant macro , called
> "ftpWithChecksum".
> The purpose of this macro is to work as a layer over
> the ant ftp task.
> The macro will, as the name says, provide a check of
> checksums of the
> files.
> I want the corresponding checksum files to be
> downloaded from the same
> serverand directory.
> There is one checksum file for each ordinary file.
> The checksum file
> contains the MD5 checksum for the 'real' file.
> 
> When calling this macro I submit a parameter A which
> is the fileset.
> This fileset represents the 'real' files of
> interest.
> But in addition the macro should download another
> set of files,
> checksumfiles.
> So if the fileset A points to file a,b,c, then in
> the macro I would like
> to create a fileset
> B, which refers to files a.MD5, b.MD5, c.MD5. The
> attribute 'dir' should
> be the same as in fileset A.
> Then the "ftpwithChecksum" macro can call ant ftp
> task twice. First to
> download the 'real' files using fileset A, second to
> download the 
> Checksum files using fileset B.
> 
> My question is then.
> Is it possible to create the fileset B ? In case how
> ?
> Thank you for you attention and time.
> Ivar
> 
>  -----Original Message-----
> From: EJ Ciramella [mailto:ejciramella@upromise.com]
> 
> Sent: Wednesday, August 06, 2008 6:55 PM
> To: Ant Users List
> Subject: RE: fileset manipulation
> 
> Are you talking about referencing the first file
> set?
> 
> Why not have two path refids?
> 
> Can I have a little more context to go with this
> question?  Where is
> this fileset getting used?
> 
> -----Original Message-----
> From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
> Sent: Wednesday, August 06, 2008 5:37 AM
> To: user@ant.apache.org
> Subject: fileset manipulation
> 
> If I have fileset A:
> 
> <fileset dir='.' >
> <include name="a" />
> </fileset>
> 
> Is it possible to get the following fileset by a
> command that takes
> fileset A as an argument in ?
> 
> <fileset dir='.' >
> <include name="a.extension" />
> </fileset>
> 
> Best regards
> Ivar
> 
>
---------------------------------------------------------------------
> 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
> 
> 
>
---------------------------------------------------------------------
> 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
> 
> 



      

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


RE: fileset manipulation

Posted by EJ Ciramella <ej...@upromise.com>.
If this is a custom task/macro, couldn't you just programmatically
generate that secondary fileset?

This is out there on the fringe of my ant knowledge, so it's plausible
you could do this within ant (with a refid or some other kind of
reference back to the original fileset), but I can't say for sure and
nothing pops out in the documentation.

-----Original Message-----
From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
Sent: Thursday, August 07, 2008 3:33 AM
To: Ant Users List
Subject: RE: fileset manipulation

Ok, to be more precise:
I have defined an ant macro , called "ftpWithChecksum".
The purpose of this macro is to work as a layer over the ant ftp task.
The macro will, as the name says, provide a check of checksums of the
files.
I want the corresponding checksum files to be downloaded from the same
serverand directory.
There is one checksum file for each ordinary file. The checksum file
contains the MD5 checksum for the 'real' file.

When calling this macro I submit a parameter A which is the fileset.
This fileset represents the 'real' files of interest.
But in addition the macro should download another set of files,
checksumfiles.
So if the fileset A points to file a,b,c, then in the macro I would like
to create a fileset
B, which refers to files a.MD5, b.MD5, c.MD5. The attribute 'dir' should
be the same as in fileset A.
Then the "ftpwithChecksum" macro can call ant ftp task twice. First to
download the 'real' files using fileset A, second to download the 
Checksum files using fileset B.

My question is then.
Is it possible to create the fileset B ? In case how ?
Thank you for you attention and time.
Ivar

 -----Original Message-----
From: EJ Ciramella [mailto:ejciramella@upromise.com] 
Sent: Wednesday, August 06, 2008 6:55 PM
To: Ant Users List
Subject: RE: fileset manipulation

Are you talking about referencing the first file set?

Why not have two path refids?

Can I have a little more context to go with this question?  Where is
this fileset getting used?

-----Original Message-----
From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
Sent: Wednesday, August 06, 2008 5:37 AM
To: user@ant.apache.org
Subject: fileset manipulation

If I have fileset A:

<fileset dir='.' >
<include name="a" />
</fileset>

Is it possible to get the following fileset by a command that takes
fileset A as an argument in ?

<fileset dir='.' >
<include name="a.extension" />
</fileset>

Best regards
Ivar

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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: fileset manipulation

Posted by Ivar Bratberg <Iv...@fast.no>.
Ok, to be more precise:
I have defined an ant macro , called "ftpWithChecksum".
The purpose of this macro is to work as a layer over the ant ftp task.
The macro will, as the name says, provide a check of checksums of the
files.
I want the corresponding checksum files to be downloaded from the same
serverand directory.
There is one checksum file for each ordinary file. The checksum file
contains the MD5 checksum for the 'real' file.

When calling this macro I submit a parameter A which is the fileset.
This fileset represents the 'real' files of interest.
But in addition the macro should download another set of files,
checksumfiles.
So if the fileset A points to file a,b,c, then in the macro I would like
to create a fileset
B, which refers to files a.MD5, b.MD5, c.MD5. The attribute 'dir' should
be the same as in fileset A.
Then the "ftpwithChecksum" macro can call ant ftp task twice. First to
download the 'real' files using fileset A, second to download the 
Checksum files using fileset B.

My question is then.
Is it possible to create the fileset B ? In case how ?
Thank you for you attention and time.
Ivar

 -----Original Message-----
From: EJ Ciramella [mailto:ejciramella@upromise.com] 
Sent: Wednesday, August 06, 2008 6:55 PM
To: Ant Users List
Subject: RE: fileset manipulation

Are you talking about referencing the first file set?

Why not have two path refids?

Can I have a little more context to go with this question?  Where is
this fileset getting used?

-----Original Message-----
From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
Sent: Wednesday, August 06, 2008 5:37 AM
To: user@ant.apache.org
Subject: fileset manipulation

If I have fileset A:

<fileset dir='.' >
<include name="a" />
</fileset>

Is it possible to get the following fileset by a command that takes
fileset A as an argument in ?

<fileset dir='.' >
<include name="a.extension" />
</fileset>

Best regards
Ivar

---------------------------------------------------------------------
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


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


RE: fileset manipulation

Posted by EJ Ciramella <ej...@upromise.com>.
Are you talking about referencing the first file set?

Why not have two path refids?

Can I have a little more context to go with this question?  Where is
this fileset getting used?

-----Original Message-----
From: Ivar Bratberg [mailto:Ivar.Bratberg@fast.no] 
Sent: Wednesday, August 06, 2008 5:37 AM
To: user@ant.apache.org
Subject: fileset manipulation

If I have fileset A:

<fileset dir='.' >
<include name="a" />
</fileset>

Is it possible to get the following fileset by a command that takes
fileset A as an argument in ?

<fileset dir='.' >
<include name="a.extension" />
</fileset>

Best regards
Ivar

---------------------------------------------------------------------
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