-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcibuild.proj
40 lines (33 loc) · 2.26 KB
/
cibuild.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<Project ToolsVersion="15.0" DefaultTargets="TestWithCoverage;AnalyzeTestResults;Package">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildThisFileDirectory)</SolutionDir>
<AllTestsPassed>true</AllTestsPassed>
<PackageVersion Condition="'$(APPVEYOR_REPO_TAG_NAME)' != ''">$(APPVEYOR_REPO_TAG_NAME)</PackageVersion>
</PropertyGroup>
<PropertyGroup>
<NuGetPackageDir>$(UserProfile)\.nuget\packages\</NuGetPackageDir>
<OpenCoverExe>$(NuGetPackageDir)OpenCover\4.6.519\tools\OpenCover.Console.exe</OpenCoverExe>
<DotNetExe>C:\Program Files\dotnet\dotnet.exe</DotNetExe>
</PropertyGroup>
<Target Name="TestWithCoverage">
<ItemGroup>
<TestProjects Include="$(SolutionDir)test\**\*.csproj" />
<PreviousTestResultsFiles Include="$(SolutionDir)TestResults\*.trx" />
</ItemGroup>
<Delete Files="$(SolutionDir)Test-Coverage.xml" />
<Delete Files="@(PreviousTestResultsFiles)" />
<Exec Command='$(OpenCoverExe) -oldstyle -mergeoutput -mergebyhash -coverbytest -register:user "-target:$(DotNetExe)" -targetdir:%(TestProjects.RelativeDir) -targetargs:"test --no-build --configuration $(Configuration) --logger trx;LogFileName=$(SolutionDir)TestResults\%(TestProjects.FileName).trx %(TestProjects.Identity)" -filter:"+[Midmid*]* -[*Test*]*" -output:$(SolutionDir)Test-Coverage.xml -returntargetcode' IgnoreExitCode="true">
<Output TaskParameter="ExitCode" ItemName="TestExitCodes" />
</Exec>
<PropertyGroup>
<AllTestsPassed Condition="'%(TestExitCodes.Identity)' != '0'">false</AllTestsPassed>
</PropertyGroup>
</Target>
<Target Name="AnalyzeTestResults">
<Error Text="One or more test(s) failed." Condition="'$(AllTestsPassed)' != 'true'" />
</Target>
<Target Name="Package" Condition="$(PackageVersion) != ''">
<Exec Command='"$(DotNetExe)" pack "$(SolutionDir)src\Midmid.Configuration.MongoDb\Midmid.Configuration.MongoDb.csproj" --no-build --configuration $(Configuration) /p:PackageVersion=$(PackageVersion) --output nupkg' />
</Target>
</Project>