forked from AutoFixture/AutoFixture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildRelease.msbuild
177 lines (170 loc) · 10.7 KB
/
BuildRelease.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CompleteBuild" ToolsVersion="4.0">
<PropertyGroup>
<XUnitPath>Packages\xunit.runner.msbuild\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS</XUnitPath>
</PropertyGroup>
<UsingTask TaskName="Xunit.Runner.MSBuild.xunit" AssemblyFile="$(XUnitPath)\xunit.runner.msbuild.dll" />
<PropertyGroup>
<MSBuildExtensionsPath>Lib\MSBuildCommunityTasks</MSBuildExtensionsPath>
</PropertyGroup>
<PropertyGroup>
<NUnitToolsFolder>Packages\NUnit.Runners.2.6.2\tools</NUnitToolsFolder>
</PropertyGroup>
<UsingTask TaskName="MSBuild.Community.Tasks.Zip" AssemblyFile="$(MSBuildExtensionsPath)\MSBuild.Community.Tasks.dll" />
<UsingTask TaskName="MSBuild.Community.Tasks.NUnit" AssemblyFile="$(MSBuildExtensionsPath)\MSBuild.Community.Tasks.dll" />
<ItemGroup>
<ProjectToBuild Include="Src\*.sln" />
</ItemGroup>
<ItemGroup>
<BuildOutput Include="Src\AutoFixture\bin\Release\Ploeh.AutoFixture.dll" />
<BuildOutput Include="Src\AutoFixture\bin\Release\Ploeh.AutoFixture.pdb" />
<BuildOutput Include="Src\AutoFixture\bin\Release\Ploeh.AutoFixture.XML" />
<BuildOutput Include="Src\SemanticComparison\bin\Release\Ploeh.SemanticComparison.dll" />
<BuildOutput Include="Src\SemanticComparison\bin\Release\Ploeh.SemanticComparison.pdb" />
<BuildOutput Include="Src\SemanticComparison\bin\Release\Ploeh.SemanticComparison.XML" />
<BuildOutput Include="Src\AutoMoq\bin\Release\Ploeh.AutoFixture.AutoMoq.dll" />
<BuildOutput Include="Src\AutoMoq\bin\Release\Ploeh.AutoFixture.AutoMoq.pdb" />
<BuildOutput Include="Src\AutoMoq\bin\Release\Ploeh.AutoFixture.AutoMoq.XML" />
<BuildOutput Include="Src\AutoRhinoMock\bin\Release\Ploeh.AutoFixture.AutoRhinoMock.dll" />
<BuildOutput Include="Src\AutoRhinoMock\bin\Release\Ploeh.AutoFixture.AutoRhinoMock.pdb" />
<BuildOutput Include="Src\AutoRhinoMock\bin\Release\Ploeh.AutoFixture.AutoRhinoMock.XML" />
<BuildOutput Include="Src\AutoFakeItEasy\bin\Release\Ploeh.AutoFixture.AutoFakeItEasy.dll" />
<BuildOutput Include="Src\AutoFakeItEasy\bin\Release\Ploeh.AutoFixture.AutoFakeItEasy.pdb" />
<BuildOutput Include="Src\AutoFakeItEasy\bin\Release\Ploeh.AutoFixture.AutoFakeItEasy.XML" />
<BuildOutput Include="Src\AutoNSubstitute\bin\Release\Ploeh.AutoFixture.AutoNSubstitute.dll" />
<BuildOutput Include="Src\AutoNSubstitute\bin\Release\Ploeh.AutoFixture.AutoNSubstitute.pdb" />
<BuildOutput Include="Src\AutoNSubstitute\bin\Release\Ploeh.AutoFixture.AutoNSubstitute.XML" />
<BuildOutput Include="Src\AutoFoq\bin\Release\Ploeh.AutoFixture.AutoFoq.dll" />
<BuildOutput Include="Src\AutoFoq\bin\Release\Ploeh.AutoFixture.AutoFoq.pdb" />
<BuildOutput Include="Src\AutoFoq\bin\Release\Ploeh.AutoFixture.AutoFoq.XML" />
<BuildOutput Include="Src\AutoFixture.xUnit.net\bin\Release\Ploeh.AutoFixture.Xunit.dll" />
<BuildOutput Include="Src\AutoFixture.xUnit.net\bin\Release\Ploeh.AutoFixture.Xunit.pdb" />
<BuildOutput Include="Src\AutoFixture.xUnit.net\bin\Release\Ploeh.AutoFixture.Xunit.XML" />
<BuildOutput Include="Src\AutoFixture.xUnit.net2\bin\Release\Ploeh.AutoFixture.Xunit2.dll" />
<BuildOutput Include="Src\AutoFixture.xUnit.net2\bin\Release\Ploeh.AutoFixture.Xunit2.pdb" />
<BuildOutput Include="Src\AutoFixture.xUnit.net2\bin\Release\Ploeh.AutoFixture.Xunit2.XML" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.dll" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.pdb" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.XML" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.dll" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.pdb" />
<BuildOutput Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.XML" />
<BuildOutput Include="Src\Idioms\bin\Release\Ploeh.AutoFixture.Idioms.dll" />
<BuildOutput Include="Src\Idioms\bin\Release\Ploeh.AutoFixture.Idioms.pdb" />
<BuildOutput Include="Src\Idioms\bin\Release\Ploeh.AutoFixture.Idioms.XML" />
<BuildOutput Include="Src\Idioms.FsCheck\bin\Release\Ploeh.AutoFixture.Idioms.FsCheck.dll" />
<BuildOutput Include="Src\Idioms.FsCheck\bin\Release\Ploeh.AutoFixture.Idioms.FsCheck.pdb" />
<BuildOutput Include="Src\Idioms.FsCheck\bin\Release\Ploeh.AutoFixture.Idioms.FsCheck.XML" />
<BuildOutput Include="$(NUnitToolsFolder)\lib\nunit.core.interfaces.dll" />
</ItemGroup>
<ItemGroup>
<NUnitAddinFiles Include="Src\AutoFixture.NUnit2\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.dll" />
</ItemGroup>
<ItemGroup>
<NuSpecFiles Include="NuGet\*.nuspec" />
<NuGetPackageScripts Include="NuGet\*.ps1" />
<NuGetPackageScripts Include="NuGet\*.txt" />
<NuGetPackageScripts Include="NuGet\*.pp" />
</ItemGroup>
<PropertyGroup>
<ReleaseFolder>Release</ReleaseFolder>
</PropertyGroup>
<!--Optional Clean targets-->
<Target Name="CleanAll" DependsOnTargets="CleanDebug;CleanVerify;CleanRelease" />
<Target Name="CleanDebug">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Debug" />
</Target>
<Target Name="CleanVerify">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Verify" />
</Target>
<Target Name="CleanRelease">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Release" />
</Target>
<!--Build tasks-->
<Target Name="DeleteReleaseFolder">
<RemoveDir Directories="$(ReleaseFolder)" />
</Target>
<Target Name="MakeReleaseFolder" DependsOnTargets="DeleteReleaseFolder">
<MakeDir Directories="$(ReleaseFolder)" Condition="!Exists($(ReleaseFolder))" />
</Target>
<Target Name="Verify" DependsOnTargets="MakeReleaseFolder;CleanAll">
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Verify" />
</Target>
<Target Name="Build" DependsOnTargets="Verify">
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" />
</Target>
<Target Name="Test" DependsOnTargets="Build">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<ParallelizeTests Condition="'$(ParallelizeTests)' == ''">false</ParallelizeTests>
<MaxParallelThreads Condition="'$(MaxParallelThreads)' == ''">0</MaxParallelThreads>
</PropertyGroup>
<ItemGroup>
<XunitTestAssemblies
Include="Src\*Test\bin\$(Configuration)\*Test.dll"
Exclude="Src\AutoFixture.NUnit2.*Test\bin\$(Configuration)\*.dll" />
</ItemGroup>
<xunit
Assemblies="@(XunitTestAssemblies)"
ParallelizeAssemblies="$(ParallelizeTests)"
ParallelizeTestCollections="$(ParallelizeTests)"
MaxParallelThreads="$(MaxParallelThreads)"
Xml="TestResults-$(PROCESSOR_ARCHITECTURE).xml"
Html="TestResults-$(PROCESSOR_ARCHITECTURE).html" />
<NUnit ToolPath="$(NUnitToolsFolder)" Assemblies="Src\AutoFixture.NUnit2.UnitTest\bin\Release\Ploeh.AutoFixture.NUnit2.UnitTest.dll" ContinueOnError="true" />
<NUnit ToolPath="$(NUnitToolsFolder)" Assemblies="Src\AutoFixture.NUnit2.Addins.UnitTest\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.UnitTest.dll" OutputXmlFile="TestResult-Addins.xml" ContinueOnError="true" />
</Target>
<Target Name="DeleteTestResultFiles" DependsOnTargets="Test">
<Delete Files="TestResult.xml" />
<Delete Files="TestResult-Addins.xml" />
<Delete Files="TestResults-$(PROCESSOR_ARCHITECTURE).xml" />
<Delete Files="TestResults-$(PROCESSOR_ARCHITECTURE).html" />
</Target>
<Target Name="CopyToReleaseFolder" DependsOnTargets="Test">
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(ReleaseFolder)" />
<Copy SourceFiles="@(NuGetPackageScripts)" DestinationFolder="$(ReleaseFolder)" />
</Target>
<Target Name="ZipReleaseFiles" DependsOnTargets="CopyToReleaseFolder">
<ItemGroup>
<FilesToZip Include="$(ReleaseFolder)\*.*" />
</ItemGroup>
<Zip Files="@(FilesToZip)"
WorkingDirectory="$(ReleaseFolder)"
ZipFileName="$(ReleaseFolder)\AutoFixture.zip" />
</Target>
<Target Name="CreateTemporaryNuGetSpecFiles">
<PropertyGroup>
<NuGetOutputFolder>NuGetPackages</NuGetOutputFolder>
</PropertyGroup>
<RemoveDir Directories="$(NuGetOutputFolder)" />
<Copy SourceFiles="@(NuSpecFiles)" DestinationFolder="$(NuGetOutputFolder)">
<Output TaskParameter="CopiedFiles" ItemName="TempNuspecFiles" />
</Copy>
</Target>
<Target Name="NuGetPrepare" DependsOnTargets="CreateTemporaryNuGetSpecFiles;CopyToReleaseFolder" Outputs="%(TempNuspecFiles.Identity)">
<PropertyGroup>
<TempNuspecFilePath>%(TempNuspecFiles.FullPath)</TempNuspecFilePath>
<AssemblyFile>$(ReleaseFolder)\%(TempNuspecFiles.Filename).dll</AssemblyFile>
</PropertyGroup>
<GetAssemblyIdentity AssemblyFiles="$(AssemblyFile)">
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo" />
</GetAssemblyIdentity>
<PropertyGroup>
<Version>%(AssemblyInfo.Version)</Version>
<SemanticVersion>$(Version.Substring(0, $(Version.LastIndexOf('.'))))</SemanticVersion>
</PropertyGroup>
<XmlPoke XmlInputPath="$(TempNuspecFilePath)"
Query="//metadata/version"
Value="$(SemanticVersion)" />
<XmlPoke XmlInputPath="$(TempNuspecFilePath)"
Query="//metadata/dependencies/dependency[contains(@id, 'autofixture')]/@version"
Value="$(SemanticVersion)" />
</Target>
<Target Name="NuGetPack" DependsOnTargets="NuGetPrepare">
<Exec Command="Lib\NuGet\nuget.exe pack %(TempNuspecFiles.FullPath) -Symbols -BasePath $(ReleaseFolder) -OutputDirectory $(NuGetOutputFolder)" />
</Target>
<Target Name="CleanTemporaryNuGetSpecFiles" DependsOnTargets="NuGetPack">
<Delete Files="@(TempNuspecFiles)" />
</Target>
<Target Name="CompleteBuild" DependsOnTargets="ZipReleaseFiles;CleanTemporaryNuGetSpecFiles;DeleteTestResultFiles" />
</Project>