Ian, I've now added support for file uri's to Project.GetFullPath (and fixed an issue in the foreach task).
This will be available in the next nightly build (http://nant.sourceforge.net/nightly/builds), some time later today (in a few hours) ... Gert ----- Original Message ----- From: "Ian Davies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 27, 2004 3:01 PM Subject: [nant-dev] nant.project.buildfile in URI format > Dear NAnt Developers, > > 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 > ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
