Hi,
I have a build file that looks like:
<include buildfile="cisdb.include" />
<loadtasks assembly="CustomNAntTasks.MyPartNumbering.dll" />
<if test="${property::exists('CCNetLabel')}">
<property name="version" value="${CCNetLabel}" />
<echo message="setting version to be ${version}" />
</if>
<target name="get.part.number" description="Create the Part Number for
this build">
<property name="partNumber"
value="${imspartnumber::get-part-number(partNumberRoot,version)}" />
<echo message="my part number is ${partNumber}" />
</target>
My included build file defines a property called partNumberRoot. My
build script correctly found this property until I included it as a
parameter to a custom function that I wrote. If I try to run the
get.part.number target, I get an error that the partNumberRoot property
is not defined (complete error at the end of this email). If I define
the property on the command line, the custom function works fine.
Is there some issue with trying to use a property defined in another
file when calling a custom function?
I'm using nant 0.86 beta1 (but I also tried a nightly build I have from
1/30/2009).
Thanks,
Beth
Error:
C:\content\ContentTrunk\build\config>nant -buildfile:cc_build_cisdb.xml
-v -D:CCNetLabel=1.2.3.6 get.part.number
NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net
Buildfile:
file:///C:/content/ContentTrunk/build/config/cc_build_cisdb.xml
Target framework: Microsoft .NET Framework 3.5
Base Directory: C:\content\ContentTrunk\build\config.
Target(s) specified: get.part.number
[include] Including file
C:\content\ContentTrunk\build\config\cisdb.include.
[loadtasks] Scanning assembly "CustomNAntTasks.MyPartNumbering" for
extensions.
[echo] setting version to be 1.2.3.6
get.part.number:
BUILD FAILED
C:\content\ContentTrunk\build\config\cc_build_cisdb.xml(29,6):
Property evaluation failed.
Expression: ${mypartnumber::get-part-number(partNumberRoot,version)}
^^^^^^^^^^^^^^:
NAnt.Core.BuildException:
C:\content\ContentTrunk\build\config\cc_build_cisdb.xml(29,6):
Property evaluation failed.
Expression: ${mypartnumber::get-part-number(partNumberRoot,version)}
^^^^^^^^^^^^^^ --->
Property 'partNumberRoot' has not been set.:
NAnt.Core.BuildException: Property 'partNumberRoot' has not been set.
at NAnt.Core.ExpressionEvaluator.GetPropertyValue(String
propertyName)
at NAnt.Core.ExpressionEvaluator.EvaluateProperty(String
propertyName)
at NAnt.Core.ExpressionEvalBase.ParseValue()
--- End of inner exception stack trace ---
at NAnt.Core.PropertyDictionary.EvaluateEmbeddedExpressions(String
input, Location location, Hashtable state, Stack visiting)
at NAnt.Core.PropertyDictionary.ExpandProperties(String input,
Location location)
at NAnt.Core.Project.ExpandProperties(String input, Location
location)
at NAnt.Core.Tasks.PropertyTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean
forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Total time: 0.2 seconds.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users