Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Location attribute in property not resolving correctly

Location attribute in property not resolving correctly

2006-09-26       - By William Lopez
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Thanks for the explanation!

-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@(protected)]
Sent: Tuesday, September 26, 2006 2:09 AM
To: Ant Users List
Subject: RE: Location attribute in property not resolving correctly


Hi,

that's the reason i _always_ use the unix style ' / '
although i'm running on windows.

so if writing
dir.src=C:/Temp/compare_cmp
dir.dest=C:/Work/Dev/projects/Installer/code/Installer_c1.0.latest/cmp

it works.

also i write

//servername/...

instead of

\\servername\...


and there is more of that
if you use a path on a windows machine, f.e. :

<path id="path.order">
           <fileset dir="${foobar}">
               <include name="*.txt" />
           </fileset>
       </path>
       <timestampselector property="order.candidate"
                          pathref="path.order"
                          count="1"
                          age="eldest">
       </timestampselector>

<echo file="C:/cc_workdir/temp.order">${order.candidate}</echo>

the path in the file you echoed to looks like :

C:\the\path\to\something

the windows path separator is used as you are running on windows


so if you try to load that file as property later, you have to go like
that
<loadfile property="ordertxtfile" srcfile="C:/cc_workdir/temp.order">
  <filterchain>
    <replacestring from="\" to="/" />
  </filterchain>
</loadfile>

or
...
<replacestring from="\" to="\\" />
...

otherwise it shows the behaviour you already stumpled upon


Regards, Gilbert


-----Original Message-----
From: William Lopez [mailto:W.Lopez@(protected)]
Sent: Monday, September 25, 2006 9:38 PM
To: user@(protected)
Subject: Location attribute in property not resolving correctly

Ant: 1.6.5
Java: 1.5.0_07
OS: WinXP

I have a build.properties with the following props defined:

dir.src=C:\Temp\compare_cmp
dir.dest=C:\Work\Dev\projects\Installer\code\Installer_c1.0.latest\cmp

The build is failing because the props are being resolved without the
backslashes. Here are the <echo>s:
 [echo] Source:C:Tempcompare_cmp
 [echo] Target:C:WorkDevprojectsInstallercodeInstaller_c1.0.latestcmp

I'm stumped.

Thanks,
-Will


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected) For additional
commands, e-mail: user-help@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.