1
<Project DefaultTargets="CreateBinaryZip" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
5
<BinaryZipFileName>rowtestextension-$(Version)-nunit-$(NUnitVersion).zip</BinaryZipFileName>
6
<SourceZipFileName>rowtestextension-$(Version)-source.zip</SourceZipFileName>
10
<ReleaseBuildOutputDir>Build\$(Version)</ReleaseBuildOutputDir>
11
<ReferencesDir>References</ReferencesDir>
12
<NUnitPath>C:\Programme\NUnit $(NUnitVersion)\bin\</NUnitPath>
13
<FxCopProject>rowtestextension.fxcop</FxCopProject>
14
<FxCopReport>fxcopreport.xml</FxCopReport>
15
<DependenciesDir>References\FX2.0</DependenciesDir>
16
<TestAssemblyDir>bin\Release</TestAssemblyDir>
19
<PropertyGroup Condition="$(net11) == 'true'">
20
<BinaryZipFileName>rowtestextension-$(Version)-nunit-$(NUnitVersion)-net1.1.zip</BinaryZipFileName>
23
<PropertyGroup Condition="$(net11) == 'true'">
24
<NUnitPath>C:\Programme\NUnit $(NUnitVersion) - net 1.1\bin\</NUnitPath>
25
<BuildProperties>;TargetFX1_1=true;CustomAfterMicrosoftCommonTargets=$(ProgramFiles)\MSBuild\MSBee\MSBuildExtras.Fx1_1.CSharp.targets</BuildProperties>
26
<DependenciesDir>References\FX1.1</DependenciesDir>
27
<TestAssemblyDir>bin\FX1_1\Release</TestAssemblyDir>
31
<AssemblyInfos Include="**\AssemblyInfo.cs" />
35
<SolutionFiles Include="NUnitExtension.RowTest.sln" />
39
<TestAssemblies Include="NUnitExtension.RowTest.AddIn.UnitTests\$(TestAssemblyDir)\NUnitExtension.RowTest.AddIn.UnitTests.dll" />
43
<SampleAssemblies Include="NUnitExtension.RowTest.Sample\$(TestAssemblyDir)\NUnitExtension.RowTest.Sample.dll" />
44
<SampleAssemblies Include="NunitExtension.RowTest.Tests\$(TestAssemblyDir)\NUnitExtension.RowTest.Tests.dll" />
48
<BinaryFiles Include="NUnitExtension.RowTest\bin\Release\NUnitExtension.RowTest.dll" />
49
<BinaryFiles Include="NUnitExtension.RowTest.AddIn\bin\Release\NUnitExtension.RowTest.AddIn.dll" />
50
<BinaryFiles Include="License.txt" />
51
<BinaryFiles Include="README.txt" />
52
<BinaryFiles Include="Release Notes.txt" />
55
<ItemGroup Condition="$(net11) != 'true'">
56
<AddInFiles Include="NUnitExtension.RowTest.AddIn\bin\Release\NUnitExtension.RowTest.AddIn.dll" />
59
<ItemGroup Condition="$(net11) == 'true'">
60
<AddInFiles Include="NUnitExtension.RowTest.AddIn\bin\FX1_1\Release\NUnitExtension.RowTest.AddIn.dll" />
64
<BuildResults Include="$(ReleaseBuildOutputDir)\$(BinaryZipFileName)" />
65
<BuildResults Include="$(ReleaseBuildOutputDir)\$(SourceZipFileName)" />
69
<NUnitReferences Include="$(NUnitPath)\nunit.core.dll" />
70
<NUnitReferences Include="$(NUnitPath)\nunit.core.interfaces.dll" />
71
<NUnitReferences Include="$(NUnitPath)\nunit.framework.dll" />
72
<NUnitReferences Include="$(NUnitPath)\log4net.dll" />
76
<NMock2References Include="$(DependenciesDir)\NMock2.dll" />
79
<Target Name="SetVersionNumber">
80
<Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
82
<FileUpdate Files="@(AssemblyInfos)"
83
Regex="(\[assembly:\s*AssemblyVersion\s*\()".*"(\)\])"
84
ReplacementText="$1"$(Version)"$2" />
88
<CompileReleaseBuildDependsOn>
90
</CompileReleaseBuildDependsOn>
93
<Target Name="CompileReleaseBuild" DependsOnTargets="$(CompileReleaseBuildDependsOn)">
95
Projects="@(SolutionFiles)"
97
Properties="Configuration=Release;SignAssembly=true$(BuildProperties)" />
100
<Target Name="CompileDebugBuild">
102
Projects="@(SolutionFiles)"
104
Properties="Configuration=Debug$(BuildProperties)" />
107
<Target Name="CopyTestDependencies">
108
<Copy SourceFiles="@(NUnitReferences)" DestinationFolder="$(ReferencesDir)" />
109
<Copy SourceFiles="@(NMock2References)" DestinationFolder="$(ReferencesDir)" />
113
<RunUnitTestsDependsOn>
114
CopyTestDependencies;
116
</RunUnitTestsDependsOn>
119
<Target Name="RunUnitTests" DependsOnTargets="$(RunUnitTestsDependsOn)">
120
<Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
122
<NUnit ToolPath="$(NUnitPath)" Assemblies="@(TestAssemblies)" />
126
<RunStaticAnalysisDependsOn>
128
</RunStaticAnalysisDependsOn>
131
<Target Name="RunStaticAnalysis" DependsOnTargets="$(RunStaticAnalysisDependsOn)" Condition="$(net11) != 'true'">
132
<Delete Files="$(FxCopReport)" />
134
<FxCop ProjectFile="$(FxCopProject)"
135
DirectOutputToConsole="False"
136
AnalysisReportFileName="$(FxCopReport)" />
140
<DeployNUnitAddInDependsOn>
142
</DeployNUnitAddInDependsOn>
145
<Target Name="DeployNUnitAddIn" DependsOnTargets="$(DeployNUnitAddInDependsOn)">
146
<Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
148
<Copy SourceFiles="@(AddInFiles)" DestinationFolder="$(NUnitPath)\addins" />
152
<RunSamplesDependsOn>
154
</RunSamplesDependsOn>
157
<Target Name="RunSamples" DependsOnTargets="$(RunSamplesDependsOn)">
158
<Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
160
<NUnit ToolPath="$(NUnitPath)" Assemblies="@(SampleAssemblies)" />
163
<Target Name="MakeOutputDir">
164
<Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
166
<MakeDir Directories="$(ReleaseBuildOutputDir)" />
170
<CreateSourceZipDependsOn>
172
</CreateSourceZipDependsOn>
175
<Target Name="CreateSourceZip" DependsOnTargets="$(CreateSourceZipDependsOn)" Condition="$(net11) != 'true'">
176
<Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
178
<CreateItem Include="**\*.*"
179
Exclude="**\bin\**\*.*;**\obj\**\*.*;Build\**\*.*;References\**\*.*;TestResult.xml;*.smp;**\_svn\**;*.suo;.bzr\**">
180
<Output ItemName="SourceFiles" TaskParameter="Include" />
183
<Zip Files="@(SourceFiles)"
185
ZipFileName="$(ReleaseBuildOutputDir)\$(SourceZipFileName)" />
189
<CreateBinaryZipDependsOn>
194
</CreateBinaryZipDependsOn>
197
<Target Name="CreateBinaryZip" DependsOnTargets="$(CreateBinaryZipDependsOn)">
198
<Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
199
<Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
201
<Zip Files="@(BinaryFiles)"
203
ZipFileName="$(ReleaseBuildOutputDir)\$(BinaryZipFileName)" />
206
<Target Name="Clean">
207
<Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
208
<Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
210
<Delete Files="@(BuildResults)" TreatErrorsAsWarnings="True" />