Firstly, i have to say NAnt is just the coolest .NET tool i've used yet. Well done! :)
Right, onto my bug/new-feature-request... ;) (Apologies if this has been raised before, i did check but didn't see anything related...)
i'm lazy and have a large number of sub-projects to build. So i wrote a <foreach> loop to go through the lines in a file, each line containing the name of the next project to build. (The project .build files are well-named and so i can work out, with more <foreach> loops which sub-directories they are in and call <nant> on them).
i want the project list in a separate file because i have a whole suite of applications that need to be built (each with many sub-projects) and i want my developers to not fiddle with the master build file. All i want them to do is put their entries in this simple text file. i know, i'm ashamed at my lack of faith in my colleagues... ;)
Right, so getting to my problem (sample build file and error log attached, running on Build 0.84.1455). i wanted to call the projects list file my_build_file.build.dependencies. And then in NAnt my foreach loop would refer to ${nant.project.buildfile}.dependencies:
<foreach item="Line" in="${nant.project.buildfile}.dependencies" property="line"> ...
Unfortunately, this causes a:
System.NotSupportedException: The given path's format is not supported.
So i did a bit of digging and discovered that (line 1136: Nant.Core.Project.cs (CtorHelper)) you store the nant.project.buildfile as a URI. Unfortunately (line 923: Nant.Core.Project.cs (GetFullPath)) System.IO.Path doesn't understand URIs and so Path.IsRootedPath returns false, and then Path.Combine simply lumps them together which in turn causes Path.GetFullPath to fail.
So, is there something i'm missing? Some way to get the absolute path from the buildfile URI in NAnt? i'm writing a script to do it for me, and sticking that in my build file. But it would be really nice if i could use something like nant.project.buildfile.absolute, with the non-URI name. Or, if you could make a change to GetFullPath to check for URI names before doing the IsRootedPath...
-ian.
_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger
<?xml version="1.0" ?>
<project name="Test">
<echo message="The buildfile is '${nant.project.buildfile}'" />
<foreach item="Line" in="${nant.project.buildfile}.more_data" property="line">
<echo message="${line}" />
</foreach>
</project>my line 1 my line 2 my line 3Buildfile: file:///C:/home/iand/experiment/nant/uri_buildfile_name.build
[echo] The buildfile is 'file:///C:/home/iand/experiment/nant/uri_buildfile_name.build'
BUILD FAILED
INTERNAL ERROR
System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.AddExpressions(String[] str, Boolean checkForDuplicates, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Path.GetFullPath(String path)
at NAnt.Core.Project.GetFullPath(String path)
at NAnt.Core.Tasks.LoopTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Please send bug report to [EMAIL PROTECTED]
Total time: 0.1 seconds.
