ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elizabeth Cooper <ecoo...@ergotech.com>
Subject Re: regexp file content search to form a fileset
Date Sun, 22 Sep 2002 15:06:25 GMT
Erik:

I have already considered that I would need to write my own Selector, but 
that if there was any other practical way, it would be more favorable to my 
management-types.

We use information in the "header" area of the file to group JavaBean 
classes  into jars when we build our products. It is not for documentation 
purposes, but instead for distribution purposes. All our JavaBeans are in 
one package (directory) and I need to divide these up into categories for 
jarring. The traditional way is to mark these comments in the top section 
of the file where the  @author, etc. stuff is. For example, there is a 
separate "# comment-whatever" if the class goes into the base jar, or into 
one of several specialized jar. Also, it is common to mark a file as 
"not-released", so it does not go into any jars. To process this with Ant, 
we currently use an exec with grep and find to make a list of qualifying 
files, then use this filelist for javac. I can still do this, but it would 
be so much nicer with a regexp Selector.

Does this make sense -- I do not know much about XDoclet, and I do not 
think I need to use @tags -type marking for my purpose -- what do you think?

-Liz

At 02:37 AM 9/22/02, you wrote:
>Its easy to write a custom Selector.  Have a try.  Its documented in Ant's 
>documentation as well as the fine Java Development with Ant book :)  And 
>as far as I can tell, nothing exists to do regular expression 
>matching.  You could use <or> with two <contains> selectors if you wanted

>to allow one space there and be a little flexible, but still a bit rigid 
>and allow zero or one space - that might be a reasonable first 
>approximation for what you're trying to do.
>
>But, perhaps a bit off-topic, how about using XDoclet and @tags rather 
>than coming up with your own "# Java-Bean" metadata markup?  There is even 
>JavaBeans support in the latest CVS (soon to be release) version of 
>XDoclet.  What exactly are you doing with these tags?
>
>         Erik
>
>
>Elizabeth Cooper wrote:
>>To anyone who can help:
>>A long time ago (maybe a couple of months) I looked through the Ant 1.5 
>>documentation and came across (I thought)  a way to get a fileset using a 
>>regexp  -- searching through the CONTENTS of a source code file using a 
>>regexp search criteria to make the fileset.
>>Now I cannot find anything, so I must have been dreaming or something.
>>Now all I can find related to this is ReplaceRegExp  (uses regexp to make 
>>a file set, but based on file names, not content), and <contains> which 
>>searches the file contents, but only based on a String, not a regular 
>>expression. <contains> would be close to what I need, but I cannot search 
>>just for a string -- the match must be close to the beginning of the line 
>>and MOST IMPORTANTLY ignore white space (as well as be case insensitive).
>>For example, I have some source code that may have a comment such as "#
>>Java-Bean: True" or, in another file, "#     Java-Bean:True" and both 
>>must match the criteria (only difference is white space), so both are 
>>included in the fileset.
>>So can someone tell me if this is possible in Ant 1.5.1 and how?
>>TIA
>>
>>--
>>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


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


Mime
View raw message