ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Slash issue in ANT script
Date Mon, 30 Nov 2009 06:31:31 GMT
You should always use the slash '/' and Ant will convert it on Windows.
There is only one cases (I am aware of) where you will need the 'correct' one: if you create
files for native access:
<echo file="${build.dir}/my.bat">
  cd c:\apache-ant\1.7.1\bin
  call ant.bat
</echo>
<exec executable="cmd.exe"><arg value="${build.dir}/my.bat"/></exec>

You could use ${file.separator} but i think if you create batch/shell scripts that way you
are platform dependent anyway ...


Jan


> -----Urspr√ľngliche Nachricht-----
> Von: Gilbert Rebhan [mailto:ant@schillbaer.de] 
> Gesendet: Freitag, 27. November 2009 19:35
> An: Ant Users List
> Betreff: Re: Slash issue in ANT script
> 
> jhudson schrieb:
> > hi,
> > 
> > My script should work both in Unix and winddows, I don't 
> know how to handle
> > slash (\) in ANT script in this case. Could some one please help me.
> 
> The use of the unix slash '/' is strongly recommended, 
> whether you're on
> windows or not., ant(java) will handle it correctly.'
> i always use it that way without any problems, not only with ant but
> with java in general.Much simpler to write your/path/to/whatever than
> your\\path\\to\\whatever ..
> 
> 
> Regards, Gilbert
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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