Use "location" instead of "value" in your property task.  It will
normalize the path and also document that you are dealing with files
instead of arbitrary strings.

Here's an example:

<target name="test2">
 <property name="buildDir-value" value="${basedir}/${BuildNumber}"/>
 <property name="buildDir-location"
location="${basedir}/${BuildNumber}"/>
 <property name="InstallShieldComponentsDir-value"
value="${buildDir-value}/ISComponent"/>
 <property name="InstallShieldComponentsDir-location1"
location="${buildDir-value}/ISComponent"/>
 <property name="InstallShieldComponentsDir-location2"
location="${buildDir-location}/ISComponent"/>
 <echo>
  buildDir-value = ${buildDir-value}
  buildDir-location = ${buildDir-location}
  InstallShieldComponentsDir-value =
${InstallShieldComponentsDir-value}
  InstallShieldComponentsDir-location1 =
${InstallShieldComponentsDir-location1}
  InstallShieldComponentsDir-location2 =
${InstallShieldComponentsDir-location2}
 </echo>
</target>




By the way, here's a "best practice" convention that I use:

Define file properties in triplets:

   xxx.location == Location of file xxx (path & filename)
   xxx.dir      == Directory of file xxx
   xxx.filename == Filename (w/ext) of file xxx

An easy way to do this is:

   <property name="xxx.location" location="..."/>

   <dirname file="${xxx.location}" property="xxx.dir"/>
   <basename file="${xxx.location}" property="xxx.filename"/>

Then it's easy to keep your properties straight.


> -----Original Message-----
> From: Stephenson, Martin [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 03, 2002 6:27 AM
> To: '[EMAIL PROTECTED]'
> Subject: Path question
> 
> 
> Hi all
> 
> I have a property called "buildDir" setup as follows:
> 
> <property name="buildDir" value="${basedir}/${BuildNumber}"/>
> 
> And I also have a property "InstallShieldComponentsDir"
> 
> <property name="InstallShieldComponentsDir"
> value="${buildDir}/ISComponents"/>
> 
> Now, I'm calling a batch file, which in turn calls a program 
> with takes the
> Path stored in "InstallShieldComponentsDir"
> 
> My problem is that "InstallShieldComponentsDir" has the 
> following as an
> actual value:
> 
> F:\Development/Builds/1.0.0.0/ISComponents
> 
> But the program I'm calling doesn't like the forward-slash - it
want's
> Backslashes, ie.:
> 
> F:\Development\Builds\1.0.0.0\ISComponents
> 
> Is there some way I can search and replace the \ with a / in 
> the property ?
> 
> Thanks
> 
> Martin
> 

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to