Implementing the Analysis and/or Transformation Logic technically means implementing one or more tasks derived from the Task class.
There are two non-exclusive ways to implement a task:
- If you want the task to be executed on its own at a given time during the build process, you can implement the Execute method.
- If you want to provide a service to another task, you can implement one of the interfaces consumed by this task. For instance, the CustomAttributeDictionaryTask consumes the ICustomAttributeProvider interface and the WeaverTask consumes the IAdviceProvider interface.
If you want your plug-in to be extensible, it is recommended to
design it in such a way that it consumes public interfaces. You can
get the collection of all tasks implementing a given interface
using the TaskCollection.GetInterfaces
method.
For details on how to program with PostSharp, please refer to: