As agreed, I implemented an Available task that allows you to check for the available of a file or directory resource.
Sounds good - we can use the FrameworksCollection I've just added to do the lookup for existence of a runtime/framework.eg. <available type="File" resource="myfile.txt" property="myfile.present" />
I used "resource" instead of "file" (or "directory") for the attribute name, so we can add more resource checks (for registry key, registry value, .NET runtime, ....) later without having to add a attribute for each type of check.
we could do - or we could un camel case them in the Enum definition. Yeah, I know its good practice to use camel case and fxCop will bitch but we have a specific reason for doing it and you get better validation in the build file - ie non lower case values wiull be rejected.I would prefer to be able to use lower case values in the buildfiles, but enum members should use Pascal casing and Nant uses a case-sensitive enum parsing so you have to specify the values in pascal casing too in the buildfile (should we change the behaviour to use a case-insensitive lookup for enum members) ?
However, I don't know how the task should behave when a file or directory is not found : should I set the specified property to false or should it not set the property at all (this is how ant works) ? If I don't set the property to a value, then I don't think you can use it in the "if" and "unless" attributes and stuff, because NAnt doesn't handle this very well yet.
I already proposed to Ian a while ago, to consider a property, that has not been set to a value, to have the value "false". I know he changed this behaviour locally, but I don't know if he committed this change already or if he's planning to commit it anyway.
That not quite what the proposal was. It was to allow the referencgin of properties in if attributes without the ${} syntax. And then return true if the property exists and is set to true otherwise false.
I was holding off on this because I was wanting to see what Gerrys expression evaluation implementation was going to look like. Since it seems he is in no hurry to commit that I'll o some testing and then add it in.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers