Are There Any Best Practices for Writing Custom NAnt, Ant, or MSBuild tasks

antmsbuildnant

I'm in the process of writing a custom task for NAnt. I've been basing how I write the code based on some examples I've found on the Internet and by looking at the source of some other tasks for both NAnt and Ant.

With that being said, are there any guidelines or best practices for writing good tasks for build managers like NAnt, Ant, or MSBuild? I'm looking for such in terms of exception handling and modularity (i.e. if my task does something with the file structure should I delete and recreate the output file/directory of my task or back it up somehow, etc.).

EDIT: I'm looking for guidelines on custom task creation. If I wanted to create my own task for NUnit or Selenium or to compile F# (I know they already exists but just saying that these are tasks not in the original core of most build managers), what are some best practices on writing my own task. I have no issues with build files. Just looking at guidance for writing new compiled tasks.

Thanks

Related Topic