Bob,
You are correct in that I'm trying to put together a couple of variables.
The build order is assigned to the variable ${properties.project.Ord}. I then 
append to the end of that variable the .ProjectName, .ViewName, and .Label and 
assign them to ${ProjectName}. I then pass $ProjectName to my starteam checkout.

The trouble is that ${properties.project.Ord} returns as "NETDLLS" but when I 
want the variable ${NETDLLS.ProjectName} to be returned as
"NETDLLs.ProjectName=Windows - .NET DLLs" it instead comes back as 
"NETDLLS.ProjectName".

StarTeam goes looking for a NETDLLS.ProjectName and of course can't find it and 
dies.

Thanks for the help!
Much appreciated!
-Doug

-----Original Message-----
From: Bob Archer [mailto:bob.arc...@amsi.com]
Sent: Monday, June 17, 2013 9:22 AM
To: Labout, Douglas; 'nant-users@lists.sourceforge.net'
Subject: RE: Nested variables

> Hello,
> I'm working on converting an Ant script to Nant and have ran into an
> issue with joining several variables together in Nant.
>
> Below is the original Ant script in which it pulls information from a
> properties file and uses the information to feed the build. The
> project starts by looping through build order (NETDLLS, App) and then
> uses that variable to prepend to the ProjectName to check out of StarTeam.
>
> Project.Build.Order=NETDLLs,App
>
> # Windows - .NET DLLs
> NETDLLs.ProjectName=Windows - .NET DLLs NETDLLs.ViewName=Windows -
> .NET DLLs
> NETDLLs.Label=201300722.20130508
>
> ANT script:
> <target name="build.project">
>       <property name="ProjectName"
> value="${buildProp.${project.Ord}.ProjectName}"/>
>       <property name="ViewName"
> value="${buildProp.${project.Ord}.ViewName}"/>
>       <property name="Label"
> value="${buildProp.${project.Ord}.Label}"/>
>
>       <antcall target="checkoutModuleSrc" inheritall="true"/>
>
> Here is what I have come up with in Nant which doesn't seem to be working.
>
> NAnt script:
> <target name="build.project">
>       <property name="ProjectName"
> value="${'properties.project.Ord'+'.ProjectName'}"/>
>       <property name="ViewName"
> value="${'properties.project.Ord'+'.ViewName'}"/>
>       <property name="Label"
> value="${'properties.project.Ord'+'.Label'}"/>
>       <echo>${ProjectName} ${ViewName} ${Label}</echo>
>       <call target="checkoutModuleSrc"/>
>

I assume based on your title "nested variables" you want to do something like 
this:


<property name="ProjectName" 
value="${property::get-value('properties.project.Ord.ProjectName')}"/>

?????

BOb



> Results of the script at the command line:
> checkoutModuleSrc:
>
>      [exec] StarTeam 10.4 Command Line Interface, Build 10.4.8.36
>      [exec] Copyright (c) 2003-2008 Borland Software Corporation. All
> rights res erved.
>      [exec] Using ini file: C:\Documents and Settings\All
> Users\Application Data \Borland\StarTeam\ConnectionManager.ini
>      [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
> document attached hereto or transmitted herewith is confidential and
> intended for the exclusive use of the individual or entity named
> above. If the reader of this message is not the intended recipient or
> the employee or agent responsible for delivering it to the intended
> recipient, you are hereby notified that any examination, use,
> dissemination, distribution or copying of this communication or any
> part thereof is strictly prohibited. If you have received this
> communication in error, please immediately notify the sender by reply e-mail 
> and destroy this communication. Thank you.

The information contained in this electronic communication and any document 
attached hereto or transmitted herewith is confidential and intended for the 
exclusive use of the individual or entity named above. If the reader of this 
message is not the intended recipient or the employee or agent responsible for 
delivering it to the intended recipient, you are hereby notified that any 
examination, use, dissemination, distribution or copying of this communication 
or any part thereof is strictly prohibited. If you have received this 
communication in error, please immediately notify the sender by reply e-mail 
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
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to