Is there a way to access the Project
object from a NAnt extension function, as can be done from an extension task?
In this example, I want to use the BaseDirectory
property inside the Bar
function:
[FunctionSet("foo", "Foo")]
public class FooFunctions : FunctionSetBase
{
public FooFunctions(Project project, PropertyDictionary properties)
: base(project, properties)
{
// When does this constructor gets called?
}
[Function("bar")]
public static string Bar(string name)
{
return "Bar!"; // How to get at project.BaseDirectory?
}
}
I'm new to NAnt extensions, so I don't know if this is even a valid question or if I should approach the problem differently.