~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/release-build.proj

  • Committer: charliepoole
  • Date: 2008-05-05 22:17:22 UTC
  • Revision ID: vcs-imports@canonical.com-20080505221722-7bdjujqed8pk6al3
Add back RowTestExtension as a separately compiled assembly, bundled
with NUnit, and modify build script to handle addins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<Project DefaultTargets="CreateBinaryZip" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
2
        <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
 
3
        
 
4
        <PropertyGroup>
 
5
                <BinaryZipFileName>rowtestextension-$(Version)-nunit-$(NUnitVersion).zip</BinaryZipFileName>
 
6
                <SourceZipFileName>rowtestextension-$(Version)-source.zip</SourceZipFileName>
 
7
        </PropertyGroup>
 
8
        
 
9
        <PropertyGroup>
 
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>
 
17
        </PropertyGroup>
 
18
        
 
19
        <PropertyGroup Condition="$(net11) == 'true'">
 
20
                <BinaryZipFileName>rowtestextension-$(Version)-nunit-$(NUnitVersion)-net1.1.zip</BinaryZipFileName>
 
21
        </PropertyGroup>
 
22
        
 
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>
 
28
        </PropertyGroup>
 
29
        
 
30
        <ItemGroup>
 
31
                <AssemblyInfos Include="**\AssemblyInfo.cs" />
 
32
        </ItemGroup>
 
33
        
 
34
        <ItemGroup>
 
35
                <SolutionFiles Include="NUnitExtension.RowTest.sln" />
 
36
        </ItemGroup>
 
37
        
 
38
        <ItemGroup>
 
39
                <TestAssemblies Include="NUnitExtension.RowTest.AddIn.UnitTests\$(TestAssemblyDir)\NUnitExtension.RowTest.AddIn.UnitTests.dll" />
 
40
        </ItemGroup>
 
41
        
 
42
        <ItemGroup>
 
43
                <SampleAssemblies Include="NUnitExtension.RowTest.Sample\$(TestAssemblyDir)\NUnitExtension.RowTest.Sample.dll" />
 
44
        <SampleAssemblies Include="NunitExtension.RowTest.Tests\$(TestAssemblyDir)\NUnitExtension.RowTest.Tests.dll" />
 
45
        </ItemGroup>
 
46
        
 
47
        <ItemGroup>
 
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" />
 
53
        </ItemGroup>
 
54
        
 
55
        <ItemGroup Condition="$(net11) != 'true'">
 
56
                <AddInFiles Include="NUnitExtension.RowTest.AddIn\bin\Release\NUnitExtension.RowTest.AddIn.dll" />
 
57
        </ItemGroup>
 
58
        
 
59
        <ItemGroup Condition="$(net11) == 'true'">
 
60
                <AddInFiles Include="NUnitExtension.RowTest.AddIn\bin\FX1_1\Release\NUnitExtension.RowTest.AddIn.dll" />
 
61
        </ItemGroup>
 
62
        
 
63
        <ItemGroup>
 
64
                <BuildResults Include="$(ReleaseBuildOutputDir)\$(BinaryZipFileName)" />
 
65
                <BuildResults Include="$(ReleaseBuildOutputDir)\$(SourceZipFileName)" />
 
66
        </ItemGroup>
 
67
        
 
68
        <ItemGroup>
 
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" />
 
73
        </ItemGroup>
 
74
        
 
75
        <ItemGroup>
 
76
                <NMock2References Include="$(DependenciesDir)\NMock2.dll" />
 
77
        </ItemGroup>
 
78
        
 
79
        <Target Name="SetVersionNumber">
 
80
                <Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
 
81
        
 
82
                <FileUpdate Files="@(AssemblyInfos)"
 
83
                                Regex="(\[assembly:\s*AssemblyVersion\s*\()&quot;.*&quot;(\)\])"
 
84
                                ReplacementText="$1&quot;$(Version)&quot;$2" />
 
85
        </Target>
 
86
        
 
87
        <PropertyGroup>
 
88
                <CompileReleaseBuildDependsOn>
 
89
                        SetVersionNumber
 
90
                </CompileReleaseBuildDependsOn>
 
91
        </PropertyGroup>
 
92
        
 
93
        <Target Name="CompileReleaseBuild" DependsOnTargets="$(CompileReleaseBuildDependsOn)">
 
94
                <MSBuild
 
95
                                Projects="@(SolutionFiles)"
 
96
                                Targets="Rebuild"
 
97
                                Properties="Configuration=Release;SignAssembly=true$(BuildProperties)" />
 
98
        </Target>
 
99
        
 
100
        <Target Name="CompileDebugBuild">
 
101
                <MSBuild
 
102
                                Projects="@(SolutionFiles)"
 
103
                                Targets="Rebuild"
 
104
                                Properties="Configuration=Debug$(BuildProperties)" />
 
105
        </Target>
 
106
        
 
107
        <Target Name="CopyTestDependencies">
 
108
                <Copy SourceFiles="@(NUnitReferences)" DestinationFolder="$(ReferencesDir)" />
 
109
                <Copy SourceFiles="@(NMock2References)" DestinationFolder="$(ReferencesDir)" />
 
110
        </Target>
 
111
        
 
112
        <PropertyGroup>
 
113
                <RunUnitTestsDependsOn>
 
114
                        CopyTestDependencies;
 
115
                        CompileReleaseBuild
 
116
                </RunUnitTestsDependsOn>
 
117
        </PropertyGroup>
 
118
        
 
119
        <Target Name="RunUnitTests" DependsOnTargets="$(RunUnitTestsDependsOn)">
 
120
                <Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
 
121
        
 
122
                <NUnit ToolPath="$(NUnitPath)" Assemblies="@(TestAssemblies)" />
 
123
        </Target>
 
124
        
 
125
        <PropertyGroup>
 
126
                <RunStaticAnalysisDependsOn>
 
127
                        CompileDebugBuild
 
128
                </RunStaticAnalysisDependsOn>
 
129
        </PropertyGroup>
 
130
        
 
131
        <Target Name="RunStaticAnalysis" DependsOnTargets="$(RunStaticAnalysisDependsOn)" Condition="$(net11) != 'true'">
 
132
                <Delete Files="$(FxCopReport)" />
 
133
                
 
134
                <FxCop ProjectFile="$(FxCopProject)"
 
135
                                         DirectOutputToConsole="False"
 
136
                                         AnalysisReportFileName="$(FxCopReport)" />
 
137
        </Target>
 
138
        
 
139
        <PropertyGroup>
 
140
                <DeployNUnitAddInDependsOn>
 
141
                        RunUnitTests
 
142
                </DeployNUnitAddInDependsOn>
 
143
        </PropertyGroup>
 
144
        
 
145
        <Target Name="DeployNUnitAddIn" DependsOnTargets="$(DeployNUnitAddInDependsOn)">
 
146
                <Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
 
147
        
 
148
                <Copy SourceFiles="@(AddInFiles)" DestinationFolder="$(NUnitPath)\addins" />
 
149
        </Target>
 
150
        
 
151
        <PropertyGroup>
 
152
                <RunSamplesDependsOn>
 
153
                        DeployNUnitAddIn
 
154
                </RunSamplesDependsOn>
 
155
        </PropertyGroup>
 
156
        
 
157
        <Target Name="RunSamples" DependsOnTargets="$(RunSamplesDependsOn)">
 
158
                <Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
 
159
 
 
160
                <NUnit ToolPath="$(NUnitPath)" Assemblies="@(SampleAssemblies)" />
 
161
        </Target>
 
162
        
 
163
        <Target Name="MakeOutputDir">
 
164
                <Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
 
165
        
 
166
                <MakeDir Directories="$(ReleaseBuildOutputDir)" />
 
167
        </Target>
 
168
        
 
169
        <PropertyGroup>
 
170
                <CreateSourceZipDependsOn>
 
171
                        MakeOutputDir
 
172
                </CreateSourceZipDependsOn>
 
173
        </PropertyGroup>
 
174
        
 
175
        <Target Name="CreateSourceZip" DependsOnTargets="$(CreateSourceZipDependsOn)" Condition="$(net11) != 'true'">
 
176
                <Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
 
177
        
 
178
                <CreateItem Include="**\*.*" 
 
179
                            Exclude="**\bin\**\*.*;**\obj\**\*.*;Build\**\*.*;References\**\*.*;TestResult.xml;*.smp;**\_svn\**;*.suo;.bzr\**">
 
180
                        <Output ItemName="SourceFiles" TaskParameter="Include" />
 
181
                </CreateItem>
 
182
        
 
183
                <Zip Files="@(SourceFiles)"
 
184
                     Flatten="False"
 
185
                     ZipFileName="$(ReleaseBuildOutputDir)\$(SourceZipFileName)" />
 
186
        </Target>
 
187
        
 
188
        <PropertyGroup>
 
189
                <CreateBinaryZipDependsOn>
 
190
                        Clean;
 
191
                        RunSamples;
 
192
                        RunStaticAnalysis;
 
193
                        MakeOutputDir
 
194
                </CreateBinaryZipDependsOn>
 
195
        </PropertyGroup>
 
196
        
 
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)' == ''" />
 
200
        
 
201
                <Zip Files="@(BinaryFiles)"
 
202
                     Flatten="True"
 
203
                     ZipFileName="$(ReleaseBuildOutputDir)\$(BinaryZipFileName)" />
 
204
        </Target>
 
205
        
 
206
        <Target Name="Clean">
 
207
                <Error Text="Property 'Version' is not set." Condition="'$(Version)' == ''" />
 
208
                <Error Text="Property 'NUnitVersion' is not set." Condition="'$(NUnitVersion)' == ''" />
 
209
 
 
210
                <Delete Files="@(BuildResults)" TreatErrorsAsWarnings="True" />
 
211
        </Target>
 
212
</Project>