ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno.Konik" <bruno.ko...@unigone.com>
Subject RE: How does one pre-append lines
Date Mon, 09 Dec 2002 07:10:59 GMT
one suggestion is to make add by the generator tool a single line at the
begining of each file. For example :
@PACKAGE_INFORMATION@

and make this replace by the right information by the ant Replace task or
use a Filter...

Of course, this implies modifying your generator tool a bit...

Bruno

> -----Message d'origine-----
> De : Stephen Rozum [mailto:rozum@ispwest.com]
> Envoyé : dimanche 8 décembre 2002 21:46
> À : ant-user@jakarta.apache.org
> Objet : How does one pre-append lines
>
>
> Hello all,
>
> I have come across the following problem and I am looking for a
> nice solution to address it.
>
> What I need to to is command similiar to <echo> with a option to
> pre-append the echo string to the beginning of the file.
>
> Note: I need this tool since some of our Java code is
> automatically generated and the tool that generates the code has
> no concepts of packages.  What I need to do is add a package
> statement to the beginning of the file.  Unfortunately, changing
> the routine that generates the code is not an option.
>
> I see three possible solutions:
>
> 1) Write an external tool class that would be called by Ant to
> prepend the string.
>
> 2) Modify Ant with a new option for prepending the data.
> Unfortunately, it would be a local modification would need to be
> re-implemented each time we update Ant with the latest revision.
>
> 3) Use existing Ant command to accomplish this task.
>
> I would like to use option 3, but being relatively new to the Ant
> environment, I am unsure of the best way of doing this.  Note:
> All of the files to be modified will be contained in thier own directory.
>
> One possible algorithm that I thought of was to:
> 1) Copy all of the *.java files to another temporary directory
> 2) For each *.java in the original directory replace the contents
> with the package information.
> 3) For each of the files in the temporary directory, concatenate
> it with its original's file name in the original directory.
>
> Thanks ahead of time for any help.
>
>
> Regards,
>
>
> Stephen
>
>
>
>
> --
> 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