-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathio.compression.msbuild
73 lines (55 loc) · 4.49 KB
/
io.compression.msbuild
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir>.\</SolutionDir>
<VSTestConsoleExe>"%VS140COMNTOOLS%..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"</VSTestConsoleExe>
<OpenCoverConsoleExe>"$(SolutionDir)..\external-opencover\OpenCover.Console.exe"</OpenCoverConsoleExe>
<ReportGeneratorExe>"$(SolutionDir)..\external-reportgenerator\ReportGenerator.exe"</ReportGeneratorExe>
<NuGetExe>"$(SolutionDir)..\external-nuget\nuget.exe"</NuGetExe>
</PropertyGroup>
<Target Name="CodeCoverage">
<PropertyGroup>
<CodeCoverageDir>$(SolutionDir)out\codecoverage\</CodeCoverageDir>
</PropertyGroup>
<!-- Clean previous code coverage report -->
<RemoveDir Directories="$(CodeCoverageDir)"/>
<!-- Build Debug x86 Target -->
<MSBuild Projects="io.compression.sln" Properties="Configuration=Debug;Platform=Win32" Targets="Rebuild" ContinueOnError="false"/>
<!-- Generate Code Coverage Report (x86) -->
<MakeDir Directories="$(CodeCoverageDir)" ContinueOnError="false"/>
<Exec Command="$(OpenCoverConsoleExe) -register:user -target:$(VsTestConsoleExe) -targetargs:"/Settings:$(SolutionDir)default.runsettings /Logger:trx /inIsolation $(SolutionDir)out\Win32\Debug\zuki.io.compression.test.dll" -filter:"+[zuki.io.compression]* -[zuki.io.compression]msclr.*" -mergebyhash -output:"$(CodeCoverageDir)\compression.xml"" ContinueOnError="true"/>
<Exec Command="$(ReportGeneratorExe) -reports:"$(CodeCoverageDir)compression.xml" -targetdir:"$(CodeCoverageDir)"" ContinueOnError="false"/>
</Target>
<Target Name="Build">
<!-- Clean Release Targets -->
<MSBuild Projects="io.compression.sln" Properties="Configuration=Release;Platform=Win32" Targets="Clean" ContinueOnError="false"/>
<MSBuild Projects="io.compression.sln" Properties="Configuration=Release;Platform=x64" Targets="Clean" ContinueOnError="false"/>
<RemoveDir Directories="$(SolutionDir)compression\tmp"/>
<RemoveDir Directories="$(SolutionDir)compression.test\tmp"/>
<!-- Clean Output Directory -->
<RemoveDir Directories="$(SolutionDir)out"/>
<!-- Build Release Targets -->
<MSBuild Projects="io.compression.sln" Properties="Configuration=Release;Platform=Win32" Targets="Rebuild" ContinueOnError="false"/>
<MSBuild Projects="io.compression.sln" Properties="Configuration=Release;Platform=x64" Targets="Rebuild" ContinueOnError="false"/>
<!-- Execute Unit Tests -->
<Exec Command="$(VSTestConsoleExe) /Settings:$(SolutionDir)default.runsettings /Platform:x86 /inIsolation $(SolutionDir)out\Win32\Release\zuki.io.compression.test.dll" ContinueOnError="false"/>
<Exec Command="$(VSTestConsoleExe) /Settings:$(SolutionDir)default.runsettings /Platform:x64 /inIsolation $(SolutionDir)out\x64\Release\zuki.io.compression.test.dll" ContinueOnError="false"/>
</Target>
<Target Name="Package" DependsOnTargets="Build">
<PropertyGroup>
<PackageVersion>$([System.IO.File]::ReadAllText($(SolutionDir)compression\tmp\version.txt))</PackageVersion>
<PackageDir>$(SolutionDir)out\package\</PackageDir>
<PackageLibDir>$(PackageDir)lib\net45\</PackageLibDir>
<PackageBuildDir>$(PackageDir)build\net45\</PackageBuildDir>
</PropertyGroup>
<!-- Generate nuget package -->
<MakeDir Directories="$(PackageDir)" ContinueOnError="false"/>
<MakeDir Directories="$(PackageLibDir)" ContinueOnError="false"/>
<MakeDir Directories="$(PackageBuildDir)" ContinueOnError="false"/>
<Copy SourceFiles="$(SolutionDir)compression\compression.nuspec" DestinationFiles="$(PackageDir)zuki.io.compression.nuspec" ContinueOnError="false"/>
<Copy SourceFiles="$(SolutionDir)out\Win32\Release\zuki.io.compression.dll" DestinationFolder="$(PackageLibDir)" ContinueOnError="false"/>
<Copy SourceFiles="$(SolutionDir)out\Win32\Release\zuki.io.compression.dll" DestinationFolder="$(PackageBuildDir)x86\" ContinueOnError="false"/>
<Copy SourceFiles="$(SolutionDir)out\x64\Release\zuki.io.compression.dll" DestinationFolder="$(PackageBuildDir)x64\" ContinueOnError="false"/>
<Copy SourceFiles="$(SolutionDir)compression\compression.targets" DestinationFiles="$(PackageBuildDir)zuki.io.compression.targets" ContinueOnError="false"/>
<Exec Command="$(NuGetExe) pack $(PackageDir)zuki.io.compression.nuspec -OutputDirectory $(PackageDir) -Version $(PackageVersion)" ContinueOnError="false" />
</Target>
</Project>