Hi,

I'm using NAnt verison 0.8.0 for an environment where we have multiple solutions each using a mix of separate and common projects.

I'm using the nant task at the solution level to call nant tasks at the project level, but I have a problem overwriting the value of properties which are also set in the project level build files. They need to have defaults set there so I can call the project level files from the command line, but they ignore the setting in the calling file despite inheritall="true". You can get the picture from this sample:

---
C:\test>type ?.build
a.build

<project name="a" default="build">
<property name="p" value="a"/>
<target name="build">
<echo message="p: ${p}"/>
<nant buildfile="b.build" target="build" inheritall="true"/>
</target>
</project>

b.build

<project name="b" default="build">
<property name="p" value="b"/>
<target name="build">
<echo message="p: ${p}"/>
</target>
</project>

C:\test>nant -buildfile:a.build
Buildfile: file:///C:/DotNet Products/Admin Console/a.build

build:
[echo] p: a
[nant] b.build build
Buildfile: file:///C:/DotNet Products/Admin Console/b.build

build:
[echo] p: b

BUILD SUCCEEDED

Total time: 0 seconds

BUILD SUCCEEDED

Total time: 0 seconds

C:\test>
---

I've tried using unless="p" in the inner property task (which the Ant documentation suggests should evaluate whether the property is defined or not) but that just generates
---
INTERNAL ERROR
System.FormatException: String was not recognized as a valid Boolean.
at System.Boolean.Parse(String value)
at System.String.System.IConvertible.ToBoolean(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at SourceForge.NAnt.Element.InitializeAttributes(XmlNode elementNode)
at SourceForge.NAnt.Element.Initialize(XmlNode elementNode)
at SourceForge.NAnt.Project.InitializeProjectDocument(XmlDocument doc)
at SourceForge.NAnt.Project.Execute()
at SourceForge.NAnt.Project.Run()

Please send bug report to [EMAIL PROTECTED]
---

Any suggestions about how to achieve this, or better ways of reusing the project files?

Thanks -

Francis.

--
"Never mind manoeuvre, go straight at 'em." - Admiral Horatio Nelson




-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about your web server security? Click here for a FREE Thawte Apache SSL Guide and answer your Apache SSL security needs: http://www.gothawte.com/rd523.html
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to