Re: Nested variables
Bob Archer <[email protected]> Mon, 17 Jun 2013 15:22:06 +0000
| Newsgroups | gmane.comp.windows.dotnet.nant.user |
|---|---|
| Message-ID | <[email protected]> |
> Hello,
> I'm working on converting an Ant script to Nant and have ran into an issu=
e with
> joining several variables together in Nant.
> =
> Below is the original Ant script in which it pulls information from a pro=
perties
> file and uses the information to feed the build. The project starts by lo=
oping
> through build order (NETDLLS, App) and then uses that variable to prepend=
to
> the ProjectName to check out of StarTeam.
> =
> Project.Build.Order=3DNETDLLs,App
> =
> # Windows - .NET DLLs
> NETDLLs.ProjectName=3DWindows - .NET DLLs
> NETDLLs.ViewName=3DWindows - .NET DLLs
> NETDLLs.Label=3D201300722.20130508
> =
> ANT script:
> <target name=3D"build.project">
> =A0 =A0=A0=A0 <property name=3D"ProjectName"
> value=3D"${buildProp.${project.Ord}.ProjectName}"/>
> =A0=A0=A0=A0=A0 <property name=3D"ViewName"
> value=3D"${buildProp.${project.Ord}.ViewName}"/>
> =A0=A0=A0=A0=A0 <property name=3D"Label" value=3D"${buildProp.${project.O=
rd}.Label}"/>
> =
> =A0=A0=A0=A0=A0 <antcall target=3D"checkoutModuleSrc" inheritall=3D"true"=
/>
> =
> Here is what I have come up with in Nant which doesn't seem to be working.
> =
> NAnt script:
> <target name=3D"build.project">
> =A0 =A0=A0=A0 <property name=3D"ProjectName"
> value=3D"${'properties.project.Ord'+'.ProjectName'}"/>
> =A0=A0=A0=A0=A0 <property name=3D"ViewName"
> value=3D"${'properties.project.Ord'+'.ViewName'}"/>
> =A0=A0=A0=A0=A0 <property name=3D"Label" value=3D"${'properties.project.O=
rd'+'.Label'}"/>
> =A0=A0=A0=A0=A0 <echo>${ProjectName} ${ViewName} ${Label}</echo>
> =A0=A0=A0=A0=A0 <call target=3D"checkoutModuleSrc"/>
> =
I assume based on your title "nested variables" you want to do something li=
ke this:
<property name=3D"ProjectName" value=3D"${property::get-value('properties.p=
roject.Ord.ProjectName')}"/>
?????
BOb
> Results of the script at the command line:
> checkoutModuleSrc:
> =
> =A0=A0=A0=A0 [exec] StarTeam 10.4 Command Line Interface, Build 10.4.8.36
> =A0=A0=A0=A0 [exec] Copyright (c) 2003-2008 Borland Software Corporation.=
All rights res
> erved.
> =A0=A0=A0=A0 [exec] Using ini file: C:\Documents and Settings\All Users\A=
pplication Data
> \Borland\StarTeam\ConnectionManager.ini
> =A0=A0=A0=A0 [exec] Project not found: properties.project.Ord.ProjectName
> =
> I would appreciate any help you can provide.
> =
> Thanks,
> -Doug Labout
> =
> =
> The information contained in this electronic communication and any docume=
nt
> attached hereto or transmitted herewith is confidential and intended for =
the
> exclusive use of the individual or entity named above. If the reader of t=
his
> message is not the intended recipient or the employee or agent responsibl=
e for
> delivering it to the intended recipient, you are hereby notified that any
> examination, use, dissemination, distribution or copying of this communic=
ation
> or any part thereof is strictly prohibited. If you have received this
> communication in error, please immediately notify the sender by reply e-m=
ail
> and destroy this communication. Thank you.
---------------------------------------------------------------------------=
---
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev