ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "T Master" <tmas...@iknowledgeinc.com>
Subject Re: search for words in a file
Date Wed, 17 Oct 2001 19:51:58 GMT
It would seem your best bet is to create your own custom ant task.
This would have a method to search a given java file for    "void
main(String[]" , and if it doesnt have that, then return the filename
including full path.

In the end, you could return a FileSet object.

Nope, never done something like that.  Fun to learn though :)



----- Original Message -----
From: <Christine.Woon@nurun.com>
To: <ant-user@jakarta.apache.org>
Sent: Wednesday, October 17, 2001 12:41 PM
Subject: Re: search for words in a file


>
> I would like to search a word within a file.  For example I do not want to
> include any *.java files in my fileset that have a 'main' method in it.
>
>
>
>                     "T Master"
>                     <tmaster@iknowled       To:
<ant-user@jakarta.apache.org>
>                     geinc.com>              cc:
>                                             Subject:     Re: search for
words in a file
>                     10/17/2001 01:54
>                     PM
>                     Please respond to
>                     ant-user
>
>
>
>
>
>
> Look at  FileSet   in the user manual.
> A FileSet  can be based upon a file, that contains a list (line seperated)
> of files to include.
> Another file cna be used to exclude a list of files.
>
> If you can, think about your logic use, and modify to suit.
>
> T Master.
>
> From: <Christine.Woon@nurun.com>
> Sent: Wednesday, October 17, 2001 7:30 AM
> Subject: search for words in a file
>
>
> > I am new at Ant, and was curious if there is any task to search for a
> > specific word i.e 'main' in a file.
> > If the word doesn't exist then include it in a fileset, otherwise ignore
> > it.
>
>
>
>
>
>


Mime
View raw message