I have a project structure that looks like this:
Parent
— ChildProjects1
— ChildProjects2
— ChildProjects3
I have an msbuild file under each ChildProjects node that builds the relevant projects, creates zip files, tags them in subversion etc
However most of this logic is common between ChildProjects. I’m wondering if I can refactor this common logic to sit in another msbuild file at the parent level and have each child inherit this?
Any ideas on this appreciated.
You can put common Targets inside an a file that you include using the following syntax, you will also see it in your proj files:
Things to note:
Call Target
In relation to the question about
CallTarget. CallTarget will invoke the specified target(s) the same way thatDependsOnTargets,BeforeTargetsandAfterTargetsdo. The target will only be run if it has not already been run. See the following example:Which will output the following: