You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Inger, Matthew" <in...@Synygy.com> on 2003/01/10 20:25:07 UTC

echo and filesets

Would it be possible (i would even be willing to write the code) to 
extend the echo task so that it could take a fileset argument?  And
it would either echo the fileset to the standard output area, or to
the file specified in the command?

ie.


<fileset id="myFs" dir="src" includes="**/*.java" />

<echo file="fileList.txt">
  <fileset refid="myFs" />
</echo>


Reason i ask is that right now, we are using the exec command
and specifying an output file for a "cmd.exe /c dir /s /b *.java" command to
get the filelist.  I'd rather do it in a more os independent manner.

Once we have the file, we're passing the filename to the <ajc>
(aspect java compiler) for processing.  It uses the contents of
this file to actually build the project (it needs all java file names
to completely aspect and produce appropriate class files).

http://www.aspectj.org  for more info on aspectj



Re: echo and filesets

Posted by Danno Ferrin <sh...@yahoo.com>.
There really is no need to chagne the code of the echo task to get the 
desired effect, try the <pathconvert> task....

<fileset id="myFs" dir="src" includes="**/*.java" />

<pathconvert refid="myFs" property="myfs.files" 
pathsep="${line.separator}"/>

<echo file="fileList.txt">${myfs.files}</echo>

Or something to that effect, I didn't actually run this code so YMMV, 
but is seems simple enough.

--Danno

Inger, Matthew wrote:

>Would it be possible (i would even be willing to write the code) to 
>extend the echo task so that it could take a fileset argument?  And
>it would either echo the fileset to the standard output area, or to
>the file specified in the command?
>
>ie.
>
>
><fileset id="myFs" dir="src" includes="**/*.java" />
>
><echo file="fileList.txt">
>  <fileset refid="myFs" />
></echo>
>
>
>Reason i ask is that right now, we are using the exec command
>and specifying an output file for a "cmd.exe /c dir /s /b *.java" command to
>get the filelist.  I'd rather do it in a more os independent manner.
>
>Once we have the file, we're passing the filename to the <ajc>
>(aspect java compiler) for processing.  It uses the contents of
>this file to actually build the project (it needs all java file names
>to completely aspect and produce appropriate class files).
>
>http://www.aspectj.org  for more info on aspectj
>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: echo and filesets

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 10 Jan 2003, Matthew Inger <in...@synygy.com> wrote:

> Would it be possible (i would even be willing to write the code) to 
> extend the echo task so that it could take a fileset argument?

<concat>?  Is part of Ant 1.5.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>