Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 906 invoked from network); 9 Dec 2002 02:02:47 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Dec 2002 02:02:47 -0000 Received: (qmail 25153 invoked by uid 97); 9 Dec 2002 02:03:52 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 25113 invoked by uid 97); 9 Dec 2002 02:03:52 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 25101 invoked by uid 98); 9 Dec 2002 02:03:51 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Sent: 9 Dec 2002 02:02:38 GMT Message-ID: <3DF3F9BE.50200@ehatchersolutions.com> Date: Sun, 08 Dec 2002 21:02:38 -0500 From: Erik Hatcher User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: How does one pre-append lines References: <0fb0d792b0bd413eb1d688a9d9897e3a.rozum@ispwest.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N How about a little with a action? That should do the trick, right? Erik Stephen Rozum wrote: > 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 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: > For additional commands, e-mail: > > > -- To unsubscribe, e-mail: For additional commands, e-mail: