You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by arijit <gh...@wipro.com> on 2007/06/11 10:57:56 UTC
creating files
Using ANT, I want to generate some batch and property files. Is it possible
to create new files ?
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11057061
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi,
-----Original Message-----
From: arijit [mailto:ghosh.arijit@wipro.com]
Sent: Monday, June 11, 2007 1:27 PM
To: user@ant.apache.org
Subject: RE: creating files
/*
even if I load the property file, I can't see how I can read the key
value
pair from the property which is loaded and use it to replace the token
with
the read value... any sample code ?
*/
some snippets =
two propertysources, one file that is loaded via loadfile the entire
file
is loaded in one property, and another file in key=value format.
message.txt looks like =
the quick
brown
fox
jumps over
the lazy
dog
props.txt looks like =
test.foo=bar
test.fooo=baar
test.key1=bla
test.key2=blabla
test.multilinekey =\n line1 \
\n line 2 \
\n line 3 \
\n line 4 \
notice the \n line \ convention if you need multiline properties
<!-- // Properties -->
<loadfile property="message" srcFile="Y:/message.txt"/>
<property file="Y:/props.txt"/>
<!-- Properties // -->
<target name="main" depends="depends">
<echo> $${message} = ${line.separator}${message}</echo>
<echoproperties prefix="test"/>
<echo>$${test.multilinekey} = ${test.multilinekey}</echo>
</target>
give you =
main:
[echo] ${message} =
[echo] the quick
[echo] brown
[echo] fox
[echo] jumps over
[echo] the lazy
[echo] dog
[echoproperties] #Ant properties
[echoproperties] #Mon Jun 11 14:06:39 CEST 2007
[echoproperties] test.key2=blabla
[echoproperties] test.key1=bla
[echoproperties] test.multilinekey=\n line1 \n line 2 \n line 3 \n line
4
[echoproperties] test.foo=bar
[echoproperties] test.fooo=baar
[echo] ${test.multilinekey} =
[echo] line1
[echo] line 2
[echo] line 3
[echo] line 4
BUILD SUCCESSFUL
Total time: 344 milliseconds
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by arijit <gh...@wipro.com>.
i can now dynamically perform the creation from the template files..
Jukka Uusisalo-2 wrote:
>
> <property file="test.properties"/>
>
> <target name="do_replace">
> <copy tofile="result_file.txt" file="template.txt"/>
> <replace file="result_file.txt" token="_Replace_This_" value="${foo}"/>
> </target>
>
> In test.properties file i have
> foo=bar
>
> template.txt contains
> Hello World by _Replace_This_
>
> After execution target do_replace
> result_file.txt contains
> Hello World by bar
>
> - Jukka -
>
>
>> -----Original Message-----
>> From: arijit [mailto:ghosh.arijit@wipro.com]
>> Sent: 11. kesakuuta 2007 14:27
>> To: user@ant.apache.org
>> Subject: RE: creating files
>>
>>
>>
>> even if I load the property file, I can't see how I can read
>> the key value
>> pair from the property which is loaded and use it to replace
>> the token with
>> the read value... any sample code ?
>>
>> arijit wrote:
>> >
>> > thanks for that warning about <echo>.. didn't think about
>> that... i might
>> > have a Template BATCH file available to me and only use <replace> to
>> > replace the token... This wil of course, mean that I will have to
>> > manually make modifications to the template..
>> >
>> >
>> > Rebhan, Gilbert wrote:
>> >>
>> >>
>> >> Hi,
>> >>
>> >>
>> >> -----Original Message-----
>> >> From: arijit [mailto:ghosh.arijit@wipro.com]
>> >> Sent: Monday, June 11, 2007 12:01 PM
>> >> To: user@ant.apache.org
>> >> Subject: RE: creating files
>> >>
>> >> /*
>> >> great.. I can now create batch files using <echo file....
>> > and also use
>> >> <echo message.... file.... > to add contents to the file.
>> >> */
>> >>
>> >> also <echo>foobar</foobar> possible, message attribut not needed.
>> >>
>> >> But beware with echo, every blank and line feed gets written as you
>> >> write
>> >> it in <echo>, means if you don't want blanks on the left side, you
>> >> should write
>> >> starting at position 0
>> >>
>> >> /*
>> >> is it possible to read data from some property file and
>> then use it to
>> >> generate the batch file ? In other words, batch file
>> generated will have
>> >> some information which is read from the property file and
>> added to the
>> >> batch
>> >> file at runtime.
>> >> */
>> >>
>> >> you may load a whole file as property or load a file that has
>> >> propertyformat
>> >> (key=value) ,see manual <property>, <loadfile>, <loadproperties>
>> >>
>> >>
>> >> For more complicated file processing (with regular expressions ...)
>> >> you should use <script> and a language running in BSF
>> JRuby, Groovy
>> >> or Javascript recommended.
>> >>
>> >> Regards, Gilbert
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> >> For additional commands, e-mail: user-help@ant.apache.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
> http://www.nabble.com/creating-files-tf3900318.html#a11058929
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11077595
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by Jukka Uusisalo <ju...@modultek.com>.
<property file="test.properties"/>
<target name="do_replace">
<copy tofile="result_file.txt" file="template.txt"/>
<replace file="result_file.txt" token="_Replace_This_" value="${foo}"/>
</target>
In test.properties file i have
foo=bar
template.txt contains
Hello World by _Replace_This_
After execution target do_replace
result_file.txt contains
Hello World by bar
- Jukka -
> -----Original Message-----
> From: arijit [mailto:ghosh.arijit@wipro.com]
> Sent: 11. kesakuuta 2007 14:27
> To: user@ant.apache.org
> Subject: RE: creating files
>
>
>
> even if I load the property file, I can't see how I can read
> the key value
> pair from the property which is loaded and use it to replace
> the token with
> the read value... any sample code ?
>
> arijit wrote:
> >
> > thanks for that warning about <echo>.. didn't think about
> that... i might
> > have a Template BATCH file available to me and only use <replace> to
> > replace the token... This wil of course, mean that I will have to
> > manually make modifications to the template..
> >
> >
> > Rebhan, Gilbert wrote:
> >>
> >>
> >> Hi,
> >>
> >>
> >> -----Original Message-----
> >> From: arijit [mailto:ghosh.arijit@wipro.com]
> >> Sent: Monday, June 11, 2007 12:01 PM
> >> To: user@ant.apache.org
> >> Subject: RE: creating files
> >>
> >> /*
> >> great.. I can now create batch files using <echo file....
> > and also use
> >> <echo message.... file.... > to add contents to the file.
> >> */
> >>
> >> also <echo>foobar</foobar> possible, message attribut not needed.
> >>
> >> But beware with echo, every blank and line feed gets written as you
> >> write
> >> it in <echo>, means if you don't want blanks on the left side, you
> >> should write
> >> starting at position 0
> >>
> >> /*
> >> is it possible to read data from some property file and
> then use it to
> >> generate the batch file ? In other words, batch file
> generated will have
> >> some information which is read from the property file and
> added to the
> >> batch
> >> file at runtime.
> >> */
> >>
> >> you may load a whole file as property or load a file that has
> >> propertyformat
> >> (key=value) ,see manual <property>, <loadfile>, <loadproperties>
> >>
> >>
> >> For more complicated file processing (with regular expressions ...)
> >> you should use <script> and a language running in BSF
> JRuby, Groovy
> >> or Javascript recommended.
> >>
> >> Regards, Gilbert
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: user-help@ant.apache.org
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/creating-files-tf3900318.html#a11058929
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
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
RE: creating files
Posted by arijit <gh...@wipro.com>.
even if I load the property file, I can't see how I can read the key value
pair from the property which is loaded and use it to replace the token with
the read value... any sample code ?
arijit wrote:
>
> thanks for that warning about <echo>.. didn't think about that... i might
> have a Template BATCH file available to me and only use <replace> to
> replace the token... This wil of course, mean that I will have to
> manually make modifications to the template..
>
>
> Rebhan, Gilbert wrote:
>>
>>
>> Hi,
>>
>>
>> -----Original Message-----
>> From: arijit [mailto:ghosh.arijit@wipro.com]
>> Sent: Monday, June 11, 2007 12:01 PM
>> To: user@ant.apache.org
>> Subject: RE: creating files
>>
>> /*
>> great.. I can now create batch files using <echo file.... > and also use
>> <echo message.... file.... > to add contents to the file.
>> */
>>
>> also <echo>foobar</foobar> possible, message attribut not needed.
>>
>> But beware with echo, every blank and line feed gets written as you
>> write
>> it in <echo>, means if you don't want blanks on the left side, you
>> should write
>> starting at position 0
>>
>> /*
>> is it possible to read data from some property file and then use it to
>> generate the batch file ? In other words, batch file generated will have
>> some information which is read from the property file and added to the
>> batch
>> file at runtime.
>> */
>>
>> you may load a whole file as property or load a file that has
>> propertyformat
>> (key=value) ,see manual <property>, <loadfile>, <loadproperties>
>>
>>
>> For more complicated file processing (with regular expressions ...)
>> you should use <script> and a language running in BSF JRuby, Groovy
>> or Javascript recommended.
>>
>> Regards, Gilbert
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11058929
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by arijit <gh...@wipro.com>.
thanks for that warning about <echo>.. didn't think about that... i might
have a Template BATCH file available to me and only use <replace> to replace
the token... This wil of course, mean that I will have to manually make
modifications to the template..
Rebhan, Gilbert wrote:
>
>
> Hi,
>
>
> -----Original Message-----
> From: arijit [mailto:ghosh.arijit@wipro.com]
> Sent: Monday, June 11, 2007 12:01 PM
> To: user@ant.apache.org
> Subject: RE: creating files
>
> /*
> great.. I can now create batch files using <echo file.... > and also use
> <echo message.... file.... > to add contents to the file.
> */
>
> also <echo>foobar</foobar> possible, message attribut not needed.
>
> But beware with echo, every blank and line feed gets written as you
> write
> it in <echo>, means if you don't want blanks on the left side, you
> should write
> starting at position 0
>
> /*
> is it possible to read data from some property file and then use it to
> generate the batch file ? In other words, batch file generated will have
> some information which is read from the property file and added to the
> batch
> file at runtime.
> */
>
> you may load a whole file as property or load a file that has
> propertyformat
> (key=value) ,see manual <property>, <loadfile>, <loadproperties>
>
>
> For more complicated file processing (with regular expressions ...)
> you should use <script> and a language running in BSF JRuby, Groovy
> or Javascript recommended.
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11058336
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi,
-----Original Message-----
From: arijit [mailto:ghosh.arijit@wipro.com]
Sent: Monday, June 11, 2007 12:01 PM
To: user@ant.apache.org
Subject: RE: creating files
/*
great.. I can now create batch files using <echo file.... > and also use
<echo message.... file.... > to add contents to the file.
*/
also <echo>foobar</foobar> possible, message attribut not needed.
But beware with echo, every blank and line feed gets written as you
write
it in <echo>, means if you don't want blanks on the left side, you
should write
starting at position 0
/*
is it possible to read data from some property file and then use it to
generate the batch file ? In other words, batch file generated will have
some information which is read from the property file and added to the
batch
file at runtime.
*/
you may load a whole file as property or load a file that has
propertyformat
(key=value) ,see manual <property>, <loadfile>, <loadproperties>
For more complicated file processing (with regular expressions ...)
you should use <script> and a language running in BSF JRuby, Groovy
or Javascript recommended.
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: creating files
Posted by Steve Loughran <st...@apache.org>.
arijit wrote:
> i tried out "<replace file="abc.bat" token="VARIABLE" value="version"/>"
>
> it worked perfectly replacing VARIABLE with version. But my next task is to
> read the value from some property file instead of typing in the value as
> shown above.
>
> i will also try out Gilbert's suggestion to load the property value and
> retrieve using key-value pair.
>
>
>>
>
I usually have a special copy task that expands every ${something}
property in a file:
<presetdef name="expandingcopy">
<copy overwrite="true">
<filterchain>
<expandproperties/>
</filterchain>
</copy>
</presetdef>
use this whenever I want to fill in a file with ant properties:
<expandingcopy todir="${rpm.SPECS}" >
<fileset dir="${rpm.metadata.dir}" includes="**/*.spec"/>
</expandingcopy>
By setting overwrite=true you guarantee the copy always takes place,
which forces all downstream work to be rebuilt too. Apart from that, it
works very well
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by arijit <gh...@wipro.com>.
i tried out "<replace file="abc.bat" token="VARIABLE" value="version"/>"
it worked perfectly replacing VARIABLE with version. But my next task is to
read the value from some property file instead of typing in the value as
shown above.
i will also try out Gilbert's suggestion to load the property value and
retrieve using key-value pair.
arijit wrote:
>
> that's good... lets say the batch file I am creating has an entry "echo
> java -VARIABLE"... now when the actual batch file is created, VARIABLE
> has to be replaced by either version or maybe help or something else..
>
> can I use the replace task to replace sections of the batch files ? I will
> try out the replace task...
>
>
> Jukka Uusisalo-2 wrote:
>>
>>> -----Original Message-----
>>> From: arijit [mailto:ghosh.arijit@wipro.com]
>>> Sent: 11. kesakuuta 2007 13:01
>>> To: user@ant.apache.org
>>> Subject: RE: creating files
>>>
>>>
>>>
>>> great.. I can now create batch files using <echo file.... >
>>> and also use
>>> <echo message.... file.... > to add contents to the file.
>>>
>>> is it possible to read data from some property file and then use it to
>>> generate the batch file ? In other words, batch file
>>> generated will have
>>> some information which is read from the property file and
>>> added to the batch
>>> file at runtime.
>>>
>>>
>>
>> How about replace task? First generete batch file as template, then read
>> properties and replace them to batch file.
>>
>> - Jukka -
>>
>>>
>>> Rebhan, Gilbert wrote:
>>> >
>>> >
>>> > Hi,
>>> >
>>> >
>>> > -----Original Message-----
>>> > From: arijit [mailto:ghosh.arijit@wipro.com]
>>> > Sent: Monday, June 11, 2007 10:58 AM
>>> > To: user@ant.apache.org
>>> > Subject: creating files
>>> >
>>> >
>>> > /*
>>> > Using ANT, I want to generate some batch and property files. Is it
>>> > possible
>>> > to create new files ?
>>> > */
>>> >
>>> > if you speak of ascii files you go via <echo file="foobar.txt> or
>>> > <echoxml>
>>> > which is new for ant 1.7.0
>>> >
>>> > there are also some preprocessing task, which might be helpful when
>>> > creating files, simply google for ant+preprocessing
>>> >
>>> >
>>> > otherwise you can use <exec>
>>> >
>>> >
>>> > Regards, Gilbert
>>> >
>>> >
>>> ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> > For additional commands, e-mail: user-help@ant.apache.org
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>> http://www.nabble.com/creating-files-tf3900318.html#a11057910
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11058257
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
-----Original Message-----
From: arijit [mailto:ghosh.arijit@wipro.com]
Sent: Monday, June 11, 2007 12:26 PM
To: user@ant.apache.org
Subject: RE: creating files
/*
that's good... lets say the batch file I am creating has an entry "echo
java
-VARIABLE"... now when the actual batch file is created, VARIABLE has
to be
replaced by either version or maybe help or something else..
can I use the replace task to replace sections of the batch files ? I
will
try out the replace task...
*/
if you want some kind of templates have a look @ the <filter> task
or use a preprocessing task
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by arijit <gh...@wipro.com>.
that's good... lets say the batch file I am creating has an entry "echo java
-VARIABLE"... now when the actual batch file is created, VARIABLE has to be
replaced by either version or maybe help or something else..
can I use the replace task to replace sections of the batch files ? I will
try out the replace task...
Jukka Uusisalo-2 wrote:
>
>> -----Original Message-----
>> From: arijit [mailto:ghosh.arijit@wipro.com]
>> Sent: 11. kesakuuta 2007 13:01
>> To: user@ant.apache.org
>> Subject: RE: creating files
>>
>>
>>
>> great.. I can now create batch files using <echo file.... >
>> and also use
>> <echo message.... file.... > to add contents to the file.
>>
>> is it possible to read data from some property file and then use it to
>> generate the batch file ? In other words, batch file
>> generated will have
>> some information which is read from the property file and
>> added to the batch
>> file at runtime.
>>
>>
>
> How about replace task? First generete batch file as template, then read
> properties and replace them to batch file.
>
> - Jukka -
>
>>
>> Rebhan, Gilbert wrote:
>> >
>> >
>> > Hi,
>> >
>> >
>> > -----Original Message-----
>> > From: arijit [mailto:ghosh.arijit@wipro.com]
>> > Sent: Monday, June 11, 2007 10:58 AM
>> > To: user@ant.apache.org
>> > Subject: creating files
>> >
>> >
>> > /*
>> > Using ANT, I want to generate some batch and property files. Is it
>> > possible
>> > to create new files ?
>> > */
>> >
>> > if you speak of ascii files you go via <echo file="foobar.txt> or
>> > <echoxml>
>> > which is new for ant 1.7.0
>> >
>> > there are also some preprocessing task, which might be helpful when
>> > creating files, simply google for ant+preprocessing
>> >
>> >
>> > otherwise you can use <exec>
>> >
>> >
>> > Regards, Gilbert
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> > For additional commands, e-mail: user-help@ant.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
> http://www.nabble.com/creating-files-tf3900318.html#a11057910
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11058198
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by Jukka Uusisalo <ju...@modultek.com>.
> -----Original Message-----
> From: arijit [mailto:ghosh.arijit@wipro.com]
> Sent: 11. kesakuuta 2007 13:01
> To: user@ant.apache.org
> Subject: RE: creating files
>
>
>
> great.. I can now create batch files using <echo file.... >
> and also use
> <echo message.... file.... > to add contents to the file.
>
> is it possible to read data from some property file and then use it to
> generate the batch file ? In other words, batch file
> generated will have
> some information which is read from the property file and
> added to the batch
> file at runtime.
>
>
How about replace task? First generete batch file as template, then read
properties and replace them to batch file.
- Jukka -
>
> Rebhan, Gilbert wrote:
> >
> >
> > Hi,
> >
> >
> > -----Original Message-----
> > From: arijit [mailto:ghosh.arijit@wipro.com]
> > Sent: Monday, June 11, 2007 10:58 AM
> > To: user@ant.apache.org
> > Subject: creating files
> >
> >
> > /*
> > Using ANT, I want to generate some batch and property files. Is it
> > possible
> > to create new files ?
> > */
> >
> > if you speak of ascii files you go via <echo file="foobar.txt> or
> > <echoxml>
> > which is new for ant 1.7.0
> >
> > there are also some preprocessing task, which might be helpful when
> > creating files, simply google for ant+preprocessing
> >
> >
> > otherwise you can use <exec>
> >
> >
> > Regards, Gilbert
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/creating-files-tf3900318.html#a11057910
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
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
RE: creating files
Posted by arijit <gh...@wipro.com>.
great.. I can now create batch files using <echo file.... > and also use
<echo message.... file.... > to add contents to the file.
is it possible to read data from some property file and then use it to
generate the batch file ? In other words, batch file generated will have
some information which is read from the property file and added to the batch
file at runtime.
Rebhan, Gilbert wrote:
>
>
> Hi,
>
>
> -----Original Message-----
> From: arijit [mailto:ghosh.arijit@wipro.com]
> Sent: Monday, June 11, 2007 10:58 AM
> To: user@ant.apache.org
> Subject: creating files
>
>
> /*
> Using ANT, I want to generate some batch and property files. Is it
> possible
> to create new files ?
> */
>
> if you speak of ascii files you go via <echo file="foobar.txt> or
> <echoxml>
> which is new for ant 1.7.0
>
> there are also some preprocessing task, which might be helpful when
> creating files, simply google for ant+preprocessing
>
>
> otherwise you can use <exec>
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/creating-files-tf3900318.html#a11057910
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: creating files
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi,
-----Original Message-----
From: arijit [mailto:ghosh.arijit@wipro.com]
Sent: Monday, June 11, 2007 10:58 AM
To: user@ant.apache.org
Subject: creating files
/*
Using ANT, I want to generate some batch and property files. Is it
possible
to create new files ?
*/
if you speak of ascii files you go via <echo file="foobar.txt> or
<echoxml>
which is new for ant 1.7.0
there are also some preprocessing task, which might be helpful when
creating files, simply google for ant+preprocessing
otherwise you can use <exec>
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org