Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Specific parser with Ant

Thread view: 
ownowl - 03 Jan 2008 14:25 GMT
Hello

I use eclipse and ant for build an application (EAR). So I'd like to
generate a readme file constituted by comments of several sources code.

Ideally I'd like to put two spéchfic flags in source file and keep only
the text between those flags. I looked around FilterChain and
FilterReader ant tasks, but I can not find a way who work well.

Some idea ?
thanks

Olivier
Arne Vajhøj - 03 Jan 2008 23:45 GMT
> I use eclipse and ant for build an application (EAR). So I'd like to
> generate a readme file constituted by comments of several sources code.
>
> Ideally I'd like to put two spéchfic flags in source file and keep only
> the text between those flags. I looked around FilterChain and
> FilterReader ant tasks, but I can not find a way who work well.

You can write your own task. It is surprisingly easy.

Arne
Roedy Green - 04 Jan 2008 02:33 GMT
>Ideally I'd like to put two spéchfic flags in source file and keep only
>the text between those flags. I looked around FilterChain and
>FilterReader ant tasks, but I can not find a way who work well.
>
>Some idea ?

You can always write some little Java program that takes command line
parms to do what you want.

Just read the source into RAM. See
http://mindprod.com/jgloss/products.html#HUNKIO

Use indexOf to find your two flags, and substring to suck up the
juice.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 04 Jan 2008 04:22 GMT
On Fri, 04 Jan 2008 02:33:44 GMT, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>You can always write some little Java program that takes command line
>parms to do what you want.

you can hook it up as a stand alone utility. See
http://mindprod.com/jgloss/ant.html for some examples, or you can hook
it in via the Java API to integrate it even better.

All you need is a week to read all the JavaDoc for how to do it.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

ownowl - 04 Jan 2008 10:39 GMT
Roedy Green a écrit :

>> Ideally I'd like to put two spéchfic flags in source file and keep only
>> the text between those flags. I looked around FilterChain and
[quoted text clipped - 10 lines]
> Use indexOf to find your two flags, and substring to suck up the
> juice.

thank to you and Arne for your answer

I knew the way of customized java ant task (I done it in the past), but
for this case, for the moment, I prefer use native ant task. So I
finally use a workaround with filterchain and headfilter.

Olivier
Robert Klemme - 04 Jan 2008 11:31 GMT
> I use eclipse and ant for build an application (EAR). So I'd like to
> generate a readme file constituted by comments of several sources code.
>
> Ideally I'd like to put two spéchfic flags in source file and keep only
> the text between those flags. I looked around FilterChain and
> FilterReader ant tasks, but I can not find a way who work well.

You could use a combination of "find" and "sed" to accomplish this.
Maybe you do not even need "find" from an "ant" script.

Kind regards

    robert
ownowl - 04 Jan 2008 13:38 GMT
Robert Klemme a écrit :
>> I use eclipse and ant for build an application (EAR). So I'd like to
>> generate a readme file constituted by comments of several sources code.
[quoted text clipped - 9 lines]
>
>     robert

thanks Robert

I could use those commands, but they are unix commands (isn't it ?), and
I must be windows compliant. And primarily, this readme generator is a
part of several others ant tasks

Olivier
Robert Klemme - 04 Jan 2008 20:07 GMT
> Robert Klemme a écrit :
>>> I use eclipse and ant for build an application (EAR). So I'd like to
[quoted text clipped - 12 lines]
> I must be windows compliant. And primarily, this readme generator is a
> part of several others ant tasks

Well, there's cygwin and there's "Windows Services for Unix". :-)  But
maybe you find a sed implementation in Java.  Of course, writing this in
Java should not be too difficult either.

Kind regards

    robert


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.