MSBuild is the build system for Microsoft and Visual Studio. It is completely transparent in processing and building software, enabling developers to build products in development environments where Visual Studio is not present.
MSBuild uses a simple and extensible XML file format that is fully supported by Microsoft. It enables developers to fully describe what items need to be built and how they need to be built in different configurations.
This topic demonstrates how to integrate Telerik® JustMock with a MSBuild task.
MS Build tasks are units of executable code to perform build operations. Once created, tasks can be shared among different developers to be reused in different projects.
To learn more about MSBuild refer to MSDN Library.
Open your MSBuild project and under the Project node include JustMock targets file. This file is named JustMock.targets and can be found in the installation directory under the Libraries folder (by default C:\Program Files (x86)\Progress\Telerik JustMock\Libraries).
Remember to change the targets file path to the one specific for you system.
Add the following two tasks under the
Projectnode to start and stop JustMock before and after the tests run, respectively:
<Target Name="BeforeTestConfiguration"> <JustMockStart /> </Target> <Target Name="AfterTestConfiguration"> <JustMockStop /> </Target>
You can optionally link (or unlink) 3rd-party profilers:
<JustMockStart LinkProfilers="JustTrace; Visual Studio 2012 Code Coverage/IntelliTrace" /> <JustMockStop UnlinkProfilers="JustTrace; Visual Studio 2012 Code Coverage/IntelliTrace"/>
Multiple profilers can be specified by separating them with a semicolon. The names of the profilers must be specified exactly as they appear in the UI of the JustMock configuration tool. The files Telerik.JustMock.Configuration.exe and Telerik.JustMock.Configuration.exe.config must be present in the same folder as Telerik.JustMock.MSBuild.dll.