ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject Re: Reading from and Writing to files in Ant
Date Fri, 11 Jun 2004 22:21:35 GMT
Hello Robert,

I do not know the specificities of your application.

You might want to have a look at a number of standard tasks and types in 
ant which might supply the kind of functionality you want.

I guess you have the relatively typical problem of adapting a few 
settings in configuration files like the URL of a database or the
location of a particular server, ...

You might want to use a template file, mark the spots in the template 
files you want to replace by tokens like @DATABASEURL@,
and use one or the other of the standard ant mechanisms like copy with 
filterset [1], the translate task, or the replacetokens filter [3].

If you really need scripting, the scriptdef task of ant 1.6 allows you 
to write scripts in several languages supported by Apache bsf,
and run  the fragment as a task in your buildfile.

Cheers,
Antoine

[1] http://ant.apache.org/manual/CoreTypes/filterset.html
[2] http://ant.apache.org/manual/OptionalTasks/translate.html
[3] http://ant.apache.org/manual/CoreTypes/filterchain.html



Tand, Robert wrote:

>You'll have to pardon me, but I am very new to Ant...
>
>I've been scouring the web and have been unable to find an answer to this:
>
>Is it possible for me to use scripting in Ant to modify configuration files after install?
I would like to be able to supply a text file with configuration settings in the installer
that could be merged/added to existing files for other applications.
>
>I've been looking into Ant scripting, and was wondering if using something like Jython
or Groovy might help me accomplish this task.
>
>Any help would be appreciated...
>
>Rob
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>



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


Mime
View raw message