You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Resnick <ab...@gmail.com> on 2005/03/02 06:44:31 UTC

includes property not working

I'm trying to include a list of files to delete in a text file which is read
into a property (with properties expansion) and then used in the includes
property of a fileset in a delete task. For some reason when there are line
breaks in the text file, this isn't working!

		<loadfile property="to.delete" srcFile="ant.delete.txt">
			<filterchain>
				<expandproperties />
			</filterchain>
		</loadfile>
		<delete quiet="false" verbose="true"
includeEmptyDirs="true">
			<fileset dir="${dir.cab.work}"
includes="${to.delete}" />
		</delete>

If the list in the text file is separated by commas, it works fine. If I put
each pattern on its own line none of the patterns are used.

I've tried doing all sorts of line endings (unix, windows - I'm on windows
BTW). When I echo the to.delete property, I can see that it holds exactly
what it should. If I then put that text (including line breaks) as the
includes property, it works fine.

I've wasted a ton of time on this but am not able to get it working.

Thanks!


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


RE: includes property not working

Posted by David Resnick <ab...@gmail.com>.
Oops! Now I wonder why it sometimes worked for me ;-)

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Friday, March 04, 2005 00:47
To: Ant Users List
Subject: RE: includes property not working


--- David Resnick <ab...@gmail.com> wrote:

> No, I haven't. I looked at the docs for includesfile
> and because it didn't
> mention it thought that it wouldn't expand
> properties. I just tried it and
> it worked great. Thanks!
> 
> I am still curious why the property didn't work,
> though...

Because the code behind the includes attribute
explicitly uses comma and space (only) as separators. 
That's what the manual says, too.  :)

-Matt
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, March 02, 2005 17:19
> To: Ant Users List
> Subject: Re: includes property not working
> 
> Have you tried simply using includesfile rather than
> includes with your fileset?  It should expand
> properties and everything.
> 
> -Matt
> 
> --- David Resnick <ab...@gmail.com> wrote:
> 
> > I'm trying to include a list of files to delete in
> a
> > text file which is read
> > into a property (with properties expansion) and
> then
> > used in the includes
> > property of a fileset in a delete task. For some
> > reason when there are line
> > breaks in the text file, this isn't working!
> > 
> > 		<loadfile property="to.delete"
> > srcFile="ant.delete.txt">
> > 			<filterchain>
> > 				<expandproperties />
> > 			</filterchain>
> > 		</loadfile>
> > 		<delete quiet="false" verbose="true"
> > includeEmptyDirs="true">
> > 			<fileset dir="${dir.cab.work}"
> > includes="${to.delete}" />
> > 		</delete>
> > 
> > If the list in the text file is separated by
> commas,
> > it works fine. If I put
> > each pattern on its own line none of the patterns
> > are used.
> > 
> > I've tried doing all sorts of line endings (unix,
> > windows - I'm on windows
> > BTW). When I echo the to.delete property, I can
> see
> > that it holds exactly
> > what it should. If I then put that text (including
> > line breaks) as the
> > includes property, it works fine.
> > 
> > I've wasted a ton of time on this but am not able
> to
> > get it working.
> > 
> > Thanks!
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Celebrate Yahoo!'s 10th Birthday! 
> Yahoo! Netrospective: 100 Moments of the Web 
> http://birthday.yahoo.com/netrospective/
> 
>
---------------------------------------------------------------------
> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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: includes property not working

Posted by Matt Benson <gu...@yahoo.com>.
--- David Resnick <ab...@gmail.com> wrote:

> No, I haven't. I looked at the docs for includesfile
> and because it didn't
> mention it thought that it wouldn't expand
> properties. I just tried it and
> it worked great. Thanks!
> 
> I am still curious why the property didn't work,
> though...

Because the code behind the includes attribute
explicitly uses comma and space (only) as separators. 
That's what the manual says, too.  :)

-Matt
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, March 02, 2005 17:19
> To: Ant Users List
> Subject: Re: includes property not working
> 
> Have you tried simply using includesfile rather than
> includes with your fileset?  It should expand
> properties and everything.
> 
> -Matt
> 
> --- David Resnick <ab...@gmail.com> wrote:
> 
> > I'm trying to include a list of files to delete in
> a
> > text file which is read
> > into a property (with properties expansion) and
> then
> > used in the includes
> > property of a fileset in a delete task. For some
> > reason when there are line
> > breaks in the text file, this isn't working!
> > 
> > 		<loadfile property="to.delete"
> > srcFile="ant.delete.txt">
> > 			<filterchain>
> > 				<expandproperties />
> > 			</filterchain>
> > 		</loadfile>
> > 		<delete quiet="false" verbose="true"
> > includeEmptyDirs="true">
> > 			<fileset dir="${dir.cab.work}"
> > includes="${to.delete}" />
> > 		</delete>
> > 
> > If the list in the text file is separated by
> commas,
> > it works fine. If I put
> > each pattern on its own line none of the patterns
> > are used.
> > 
> > I've tried doing all sorts of line endings (unix,
> > windows - I'm on windows
> > BTW). When I echo the to.delete property, I can
> see
> > that it holds exactly
> > what it should. If I then put that text (including
> > line breaks) as the
> > includes property, it works fine.
> > 
> > I've wasted a ton of time on this but am not able
> to
> > get it working.
> > 
> > Thanks!
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Celebrate Yahoo!'s 10th Birthday! 
> Yahoo! Netrospective: 100 Moments of the Web 
> http://birthday.yahoo.com/netrospective/
> 
>
---------------------------------------------------------------------
> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


RE: includes property not working

Posted by David Resnick <ab...@gmail.com>.
No, I haven't. I looked at the docs for includesfile and because it didn't
mention it thought that it wouldn't expand properties. I just tried it and
it worked great. Thanks!

I am still curious why the property didn't work, though...

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Wednesday, March 02, 2005 17:19
To: Ant Users List
Subject: Re: includes property not working

Have you tried simply using includesfile rather than
includes with your fileset?  It should expand
properties and everything.

-Matt

--- David Resnick <ab...@gmail.com> wrote:

> I'm trying to include a list of files to delete in a
> text file which is read
> into a property (with properties expansion) and then
> used in the includes
> property of a fileset in a delete task. For some
> reason when there are line
> breaks in the text file, this isn't working!
> 
> 		<loadfile property="to.delete"
> srcFile="ant.delete.txt">
> 			<filterchain>
> 				<expandproperties />
> 			</filterchain>
> 		</loadfile>
> 		<delete quiet="false" verbose="true"
> includeEmptyDirs="true">
> 			<fileset dir="${dir.cab.work}"
> includes="${to.delete}" />
> 		</delete>
> 
> If the list in the text file is separated by commas,
> it works fine. If I put
> each pattern on its own line none of the patterns
> are used.
> 
> I've tried doing all sorts of line endings (unix,
> windows - I'm on windows
> BTW). When I echo the to.delete property, I can see
> that it holds exactly
> what it should. If I then put that text (including
> line breaks) as the
> includes property, it works fine.
> 
> I've wasted a ton of time on this but am not able to
> get it working.
> 
> Thanks!
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

---------------------------------------------------------------------
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: includes property not working

Posted by Matt Benson <gu...@yahoo.com>.
Have you tried simply using includesfile rather than
includes with your fileset?  It should expand
properties and everything.

-Matt

--- David Resnick <ab...@gmail.com> wrote:

> I'm trying to include a list of files to delete in a
> text file which is read
> into a property (with properties expansion) and then
> used in the includes
> property of a fileset in a delete task. For some
> reason when there are line
> breaks in the text file, this isn't working!
> 
> 		<loadfile property="to.delete"
> srcFile="ant.delete.txt">
> 			<filterchain>
> 				<expandproperties />
> 			</filterchain>
> 		</loadfile>
> 		<delete quiet="false" verbose="true"
> includeEmptyDirs="true">
> 			<fileset dir="${dir.cab.work}"
> includes="${to.delete}" />
> 		</delete>
> 
> If the list in the text file is separated by commas,
> it works fine. If I put
> each pattern on its own line none of the patterns
> are used.
> 
> I've tried doing all sorts of line endings (unix,
> windows - I'm on windows
> BTW). When I echo the to.delete property, I can see
> that it holds exactly
> what it should. If I then put that text (including
> line breaks) as the
> includes property, it works fine.
> 
> I've wasted a ton of time on this but am not able to
> get it working.
> 
> Thanks!
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

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


RE: includes property not working

Posted by David Resnick <ab...@gmail.com>.
Thanks for your suggestion! You are right, this would improve the
readability of the list file. But I'm still wondering why the property is
not working...

-----Original Message-----
From: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com] 
Sent: Wednesday, March 02, 2005 11:59
To: Ant Users List
Subject: Re: includes property not working

David,
--- David Resnick <ab...@gmail.com> wrote:

> I'm trying to include a list of files to delete in a
> text file which is read
> into a property (with properties expansion) and then
> used in the includes
> property of a fileset in a delete task. For some
> reason when there are line
> breaks in the text file, this isn't working!
> 
> 		<loadfile property="to.delete"
> srcFile="ant.delete.txt">
> 			<filterchain>
> 				<expandproperties />
> 			</filterchain>
> 		</loadfile>
> 		<delete quiet="false" verbose="true"
> includeEmptyDirs="true">
> 			<fileset dir="${dir.cab.work}"
> includes="${to.delete}" />
> 		</delete>
> 
> If the list in the text file is separated by commas,
> it works fine.

I would recommend you to replace the line breaks in
your file with commas. I tried to do it with regular
expression, but I am not good at them. Here is my
unsuccessfull attempt:
  <loadfile property="to.delete"
srcFile="ant.delete.txt">
    <filterchain>
      <tokenfilter>
        Here we should do smth like that with regexps
but the line below does not work :((>
        <replaceregex pattern="${ls}" replace=","/>
      </tokenfilter>
      </filterchain>
  </loadfile>

I hope someone from regexp gurus will help you.

Regards Ivan


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

---------------------------------------------------------------------
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: includes property not working

Posted by Ivan Ivanov <ra...@yahoo.com>.
David,
--- David Resnick <ab...@gmail.com> wrote:

> I'm trying to include a list of files to delete in a
> text file which is read
> into a property (with properties expansion) and then
> used in the includes
> property of a fileset in a delete task. For some
> reason when there are line
> breaks in the text file, this isn't working!
> 
> 		<loadfile property="to.delete"
> srcFile="ant.delete.txt">
> 			<filterchain>
> 				<expandproperties />
> 			</filterchain>
> 		</loadfile>
> 		<delete quiet="false" verbose="true"
> includeEmptyDirs="true">
> 			<fileset dir="${dir.cab.work}"
> includes="${to.delete}" />
> 		</delete>
> 
> If the list in the text file is separated by commas,
> it works fine.

I would recommend you to replace the line breaks in
your file with commas. I tried to do it with regular
expression, but I am not good at them. Here is my
unsuccessfull attempt:
  <loadfile property="to.delete"
srcFile="ant.delete.txt">
    <filterchain>
      <tokenfilter>
        Here we should do smth like that with regexps
but the line below does not work :((>
        <replaceregex pattern="${ls}" replace=","/>
      </tokenfilter>
      </filterchain>
  </loadfile>

I hope someone from regexp gurus will help you.

Regards Ivan


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

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