ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Patel <rakesh.mailgro...@gmail.com>
Subject Re: AW: Creating a file programmaticaly
Date Thu, 13 Apr 2006 14:59:00 GMT
thanks Matt, works great!

Matt Benson wrote:

>You talk about keeping your file indented correctly...
>I wouldn't consider that necessary anyway... In any
>event, the attached buildfile shows how to use concat
>or echo, sacrificing formatting, then using a task per
>line.
>
>-Matt
>
>--- Rakesh Patel <rakesh.mailgroups@gmail.com> wrote:
>
>  
>
>>Hi Matt,
>>
>>can you give me an example of using <echo>? I am
>>already using 
>>fixlastline=true with no result.
>>
>>Thanks
>>
>>Rakesh
>>
>>Matt Benson wrote:
>>
>>    
>>
>>>--- Rakesh Patel <rakesh.mailgroups@gmail.com>
>>>      
>>>
>>wrote:
>>    
>>
>>> 
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>almost there with the concat task but am having
>>>>problems with keeping my 
>>>>build.xml file formatted correctly and giving the
>>>>text to pass in ie if 
>>>>each line is indented, the indents go into the
>>>>        
>>>>
>>file.
>>    
>>
>>>>I tried individual staements but i can't seem to
>>>>generate a new line. 
>>>>Here's what i have so far:
>>>>
>>>><concat destfile="README"
>>>>append="true">user</concat>
>>>><concat destfile="README" append="true"
>>>>fixlastline="true" 
>>>>eol="crlf">${remote.server.username}</concat>
>>>><concat destfile="README" append="true"
>>>>fixlastline="true" 
>>>>eol="crlf">${remote.server.password}</concat>
>>>><concat destfile="README" append="true"
>>>>fixlastline="true" 
>>>>eol="crlf">put *.war</concat>
>>>><concat destfile="README" append="true"
>>>>fixlastline="true" 
>>>>eol="crlf">quit</concat>
>>>>
>>>>The output just comes out on one line.
>>>>   
>>>>
>>>>        
>>>>
>>>fixlastline="true"
>>>
>>>or, use <echo> instead of <concat>, and probably
>>>include ${line.separator} manually...
>>>
>>>-Matt
>>> 
>>>
>>>      
>>>
>>>>Rakesh
>>>>
>>>>Jan.Materne@rzf.fin-nrw.de wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>><concat destfile="myfile.txt">
>>>>>user
>>>>>scott
>>>>>tiger
>>>>>put *.war
>>>>>quit
>>>>></concat> 
>>>>>
>>>>>
>>>>>or with use of properties
>>>>>
>>>>>
>>>>><concat destfile="${file}">
>>>>>user
>>>>>${db.user}
>>>>>${db.pwd}
>>>>>put *.war
>>>>>quit
>>>>></concat> 
>>>>>
>>>>>
>>>>>Jan
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>that seems to only produce name value pairs.
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>Unfortunately, 
>>>>   
>>>>
>>>>        
>>>>
>>>>>>the file i want to create looks more like this:
>>>>>>
>>>>>>user
>>>>>>scott
>>>>>>tiger
>>>>>>put *.war
>>>>>>quit
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>---------------------------------------------------------------------
>>>      
>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>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
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.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
>>
>>
>>    
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>------------------------------------------------------------------------
>
><project default="foo">
>  <property name="dest1" location="ftpscript1" />
>  <property name="dest2" location="ftpscript2" />
>  <property name="dest3" location="ftpscript3" />
>  <property name="dest4" location="ftpscript4" />
>
>  <property name="remote.server.username" value="scott" />
>  <property name="remote.server.password" value="tiger" />
>
>  <!-- I tend to abbreviate line.separator this way: -->
>  <property name="br" value="${line.separator}" />
>
>  <target name="1">
>    <echo file="${dest1}">
>user
>${remote.server.username}
>${remote.server.password}
>put *.war
>quit
>    </echo>
>  </target>
>
>  <target name="2">
>    <concat destfile="${dest2}">
>user
>${remote.server.username}
>${remote.server.password}
>put *.war
>quit
>    </concat>
>  </target>
>
>  <target name="3">
>    <echo file="${dest3}">user${br}</echo>
>    <echo file="${dest3}" append="true">${remote.server.username}${br}</echo>
>    <echo file="${dest3}" append="true">${remote.server.password}${br}</echo>
>    <echo file="${dest3}" append="true">put *.war${br}</echo>
>    <echo file="${dest3}" append="true">quit${br}</echo>
>  </target>
>
>  <target name="4">
>    <concat destfile="${dest4}">user${br}</concat>
>    <concat destfile="${dest4}"
>            append="true">${remote.server.username}${br}</concat>
>    <concat destfile="${dest4}"
>            append="true">${remote.server.password}${br}</concat>
>    <concat destfile="${dest4}" append="true">put *.war${br}</concat>
>    <concat destfile="${dest4}" append="true">quit${br}</concat>
>  </target>
>
>  <target name="foo" depends="1,2,3,4" />
>
>  <target name="clean">
>    <delete>
>      <fileset dir="${basedir}" includes="ftpscript?" />
>    </delete>
>  </target>
>
></project>
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>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