Created
May 5, 2013 16:50
-
-
Save marcofranssen/5521367 to your computer and use it in GitHub Desktop.
Gists belonging to my blogposts http://marcofranssen.nl/ci-with-jenkins-msbuild-nuget-and-git-part-3/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" | |
DefaultTargets="Compile"> | |
<PropertyGroup> | |
<Configuration>Debug</Configuration> | |
<Platform>AnyCPU</Platform> | |
<DefineSolutionProperties>false</DefineSolutionProperties> | |
<!-- General Paths --> | |
<RootPath>$(MSBuildProjectDirectory)</RootPath> | |
<SrcPath>$(RootPath)\src</SrcPath> | |
<ReportsPath>$(RootPath)\reports</ReportsPath> | |
<ToolsPath>$(RootPath)\tools</ToolsPath> | |
<Packages>$(SrcPath)\packages</Packages> | |
<!-- MSpec --> | |
<MSpecPath>$(Packages)\Machine.Specifications.0.5.12\tools</MSpecPath> | |
<MSpecExe>mspec-clr4.exe</MSpecExe> | |
<MSpecXmlOutputFile>$(ReportsPath)\mspec-output.xml</MSpecXmlOutputFile> | |
<MSpecHtmlOutputPath>$(ReportsPath)\mspec</MSpecHtmlOutputPath> | |
<MSpecSettings></MSpecSettings> | |
<!-- OpenCover --> | |
<!-- The tools path for OpenCover --> | |
<OpenCoverPath>$(Packages)\OpenCover.4.5.1403</OpenCoverPath> | |
<OpenCoverExe>OpenCover.Console.exe</OpenCoverExe> | |
<OpenCoverFilter>-[*Specs*]* +[*]*</OpenCoverFilter> | |
<ReportGeneratorPath>$(Packages)\ReportGenerator.1.8.1.0</ReportGeneratorPath> | |
<ReportGeneratorExe>ReportGenerator.exe</ReportGeneratorExe> | |
<OpenCoverOutputFile>$(ReportsPath)\coverage-output.xml</OpenCoverOutputFile> | |
<CoverageReport>$(ReportsPath)\coverage</CoverageReport> | |
<ReportGeneratorSummary>$(ReportsPath)\coverage-summary.xml</ReportGeneratorSummary> | |
</PropertyGroup> | |
<!-- The Clean Target --> | |
<ItemGroup> | |
<ProjectFiles Include="**\*.csproj" /> | |
</ItemGroup> | |
<Target Name="Clean"> | |
<Message Importance="high" Text="Cleaning folders"/> | |
<RemoveDir Directories="$(ReportsPath)" Condition="Exists('$(ReportsPath)')" /> | |
<MakeDir Directories = "$(ReportsPath);$(ReportsPath)\MSpec;$(ReportsPath)\Coverage" /> | |
<!-- Clean the source code projects --> | |
<MSBuild Projects="@(ProjectFiles)" | |
ContinueOnError="false" | |
Targets="Clean" | |
Properties="Configuration=$(Configuration)" /> | |
</Target> | |
<!-- The LoadNuGetPackages Target --> | |
<ItemGroup> | |
<NuGetPackageConfigs Include="$(MSBuildStartupDirectory)\**\packages.config" /> | |
</ItemGroup> | |
<Target Name="LoadNuGetPackages"> | |
<Message Importance="high" Text="Retrieving packages for %(NuGetPackageConfigs.Identity)" /> | |
<Exec Command=""$(SrcPath)\.nuget\nuget" install "%(NuGetPackageConfigs.Identity)" -o "$(SrcPath)\packages"" /> | |
</Target> | |
<!-- The Compile Target --> | |
<Target Name="Compile" DependsOnTargets="Clean;LoadNuGetPackages"> | |
<Message Importance="high" Text="Compiling core projects"/> | |
<MSBuild Projects="$(SrcPath)\MyProject.Core\MyProject.Core.csproj" | |
Properties="Configuration=$(Configuration);Platform=$(Platform)" /> | |
<MSBuild Projects="$(SrcPath)\MyProject.Web\MyProject.Web.csproj;$(SrcPath)\MyProject.Win\MyProject.Win.csproj" | |
Properties="Configuration=$(Configuration);Platform=$(Platform)" | |
BuildInParallel="true" /> | |
</Target> | |
<Target Name="Specs" DependsOnTargets="Clean;LoadNuGetPackages;Compile"> | |
<CreateItem Include="**\bin\$(Configuration)\*Specs*.dll" Exclude="**\bin\$(Configuration)\*Specs*.mm.dll"> | |
<Output TaskParameter="Include" ItemName="SpecsAssemblies" /> | |
</CreateItem> | |
<PropertyGroup> | |
<MSpecCommand>"$(MSpecPath)\$(MSpecExe)" $(MSpecSettings) --xml "$(MSpecXmlOutputFile)" --html "$(MSpecHtmlOutputPath)" -t "@(SpecsAssemblies, '" "')"</MSpecCommand> | |
</PropertyGroup> | |
<Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/> | |
<Exec Command="$(MSpecCommand)" /> | |
</Target> | |
<Target Name="CodeCoverage" DependsOnTargets="Clean;LoadNuGetPackages;Compile"> | |
<CreateItem Include="**\Bin\Debug\*Specs*.dll" Exclude="**\Bin\$(Configuration)\*Specs*.mm.dll"> | |
<Output TaskParameter="Include" ItemName="SpecsAssemblies" /> | |
</CreateItem> | |
<PropertyGroup> | |
<OpenCoverCommand>"$(OpenCoverPath)\$(OpenCoverExe)" -register:user "-target:"$(MSpecPath)\$(MSpecExe)"" "-targetargs:"@(SpecsAssemblies, '" "')"" "-filter:$(OpenCoverFilter)" "-output:$(OpenCoverOutputFile)"</OpenCoverCommand> | |
<ReportGeneratorCommand>"$(ReportGeneratorPath)\$(ReportGeneratorExe)" "-reports:$(OpenCoverOutputFile)" "-targetdir:$(CoverageReport)" "-reporttypes:html;xml"</ReportGeneratorCommand> | |
</PropertyGroup> | |
<Message Importance="high" Text="Running code coverage with this command: $(OpenCoverCommand)"/> | |
<Exec Command="$(OpenCoverCommand)" /> | |
<Message Importance="high" Text="Generate report with this command: $(ReportGeneratorCommand)"/> | |
<Exec Command="$(ReportGeneratorCommand)" /> | |
<!-- Report Generator has no way to name the output file so rename it by copying and deleting the original file --> | |
<Copy SourceFiles="$(CoverageReport)\Summary.xml" DestinationFiles="$(ReportGeneratorSummary)"></Copy> | |
<Delete Files="$(CoverageReport)\Summary.xml"></Delete> | |
</Target> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<!-- OpenCover --> | |
<!-- The tools path for OpenCover --> | |
<OpenCoverPath>$(Packages)\OpenCover.4.5.1403</OpenCoverPath> | |
<OpenCoverExe>OpenCover.Console.exe</OpenCoverExe> | |
<OpenCoverFilter>-[*Specs*]* +[*]*</OpenCoverFilter> | |
<ReportGeneratorPath>$(Packages)\ReportGenerator.1.8.1.0</ReportGeneratorPath> | |
<ReportGeneratorExe>ReportGenerator.exe</ReportGeneratorExe> | |
<OpenCoverOutputFile>$(ReportsPath)\coverage-output.xml</OpenCoverOutputFile> | |
<CoverageReport>$(ReportsPath)\coverage</CoverageReport> | |
<ReportGeneratorSummary>$(ReportsPath)\coverage-summary.xml</ReportGeneratorSummary> | |
</PropertyGroup> | |
<Target Name="CodeCoverage" DependsOnTargets="Clean;LoadNuGetPackages;Compile"> | |
<CreateItem Include="**\Bin\Debug\*Specs*.dll" Exclude="**\Bin\$(Configuration)\*Specs*.mm.dll"> | |
<Output TaskParameter="Include" ItemName="SpecsAssemblies" /> | |
</CreateItem> | |
<PropertyGroup> | |
<OpenCoverCommand>"$(OpenCoverPath)\$(OpenCoverExe)" -register:user "-target:"$(MSpecPath)\$(MSpecExe)"" "-targetargs:"@(SpecsAssemblies, '" "')"" "-filter:$(OpenCoverFilter)" "-output:$(OpenCoverOutputFile)"</OpenCoverCommand> | |
<ReportGeneratorCommand>"$(ReportGeneratorPath)\$(ReportGeneratorExe)" "-reports:$(OpenCoverOutputFile)" "-targetdir:$(CoverageReport)" "-reporttypes:html;xml"</ReportGeneratorCommand> | |
</PropertyGroup> | |
<Message Importance="high" Text="Running code coverage with this command: $(OpenCoverCommand)"/> | |
<Exec Command="$(OpenCoverCommand)" /> | |
<Message Importance="high" Text="Generate report with this command: $(ReportGeneratorCommand)"/> | |
<Exec Command="$(ReportGeneratorCommand)" /> | |
<!-- Report Generator has no way to name the output file so rename it by copying and deleting the original file --> | |
<Copy SourceFiles="$(CoverageReport)\Summary.xml" DestinationFiles="$(ReportGeneratorSummary)"></Copy> | |
<Delete Files="$(CoverageReport)\Summary.xml"></Delete> | |
</Target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<!-- MSpec --> | |
<MSpecPath>$(Packages)\Machine.Specifications.0.5.12\tools</MSpecPath> | |
<MSpecExe>mspec-clr4.exe</MSpecExe> | |
<MSpecXmlOutputFile>$(ReportsPath)\mspec-output.xml</MSpecXmlOutputFile> | |
<MSpecHtmlOutputPath>$(ReportsPath)\mspec</MSpecHtmlOutputPath> | |
<MSpecSettings></MSpecSettings> | |
</PropertyGroup> | |
<Target Name="Specs" DependsOnTargets="Clean;LoadNuGetPackages;Compile"> | |
<CreateItem Include="**\bin\$(Configuration)\*Specs*.dll" Exclude="**\bin\$(Configuration)\*Specs*.mm.dll"> | |
<Output TaskParameter="Include" ItemName="SpecsAssemblies" /> | |
</CreateItem> | |
<PropertyGroup> | |
<MSpecCommand>"$(MSpecPath)\$(MSpecExe)" $(MSpecSettings) --xml "$(MSpecXmlOutputFile)" --html "$(MSpecHtmlOutputPath)" -t "@(SpecsAssemblies, '" "')"</MSpecCommand> | |
</PropertyGroup> | |
<Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/> | |
<Exec Command="$(MSpecCommand)" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment