~charlie.poole/nunitv2/equality-handlers

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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<?xml version="1.0"?>
<project name="NUnit" default="build" basedir=".">

<!-- ***************************************************************** -->
<!-- *********           Set Common Properties          ************** -->
<!-- ***************************************************************** -->
 
<target name="set-common-properties">

  <!-- Project name - used as a prefix for packages -->
  <property name="project.name" value="NUnit"/>

  <!-- NUnit Base Package Version - First three digits -->
  <property name="base.package.version" value="2.6.0"/>
 
  <!-- Nominal version used for install directory and program
       files menu. Normally the same as the package version, 
       but may differ when we are in alpha or beta. -->
  <property name="nominal.version" value="2.6" />

  <!-- Determine todays build number -->
  <property name="temp.now" value="${datetime::now()}"/>
  <property name="temp.yr" value="${datetime::get-year(temp.now)-2000}"/>
  <property name="temp.day" value="${string::pad-left(datetime::get-day-of-year(temp.now),3,'0')}"/>
  <property name="package.build.number" value="${temp.yr}${temp.day}"/>

  <!-- NUnit full package version -->
  <property name="package.version" value="${base.package.version}.${package.build.number}"/>

  <!-- Package Configuration (Release, Alpha, Beta, etc.) -->
  <property name="package.configuration" value=""/>
  
  <!-- Base name for packages - add suffix for Alpha, Beta, RC -->
  <property name="package.base.name" 
      value="${project.name}-${package.version}"/>

  <!-- Frameworks supported by this build script. The first
         installed framework found is the default for builds. 
         The first .NET and Mono frameworks found are the
         respective net and mono defaults. -->
  <property name="supported.frameworks" 
    value="net-3.5,net-2.0,net-4.0,net-1.1,net-1.0,mono-3.5,mono-2.0,mono-1.0"/>

  <!-- Packages we normally create -->
  <property name="standard.packages" value="net-3.5,net-1.1" 
      if="${platform::is-windows()}"/>
  <property name="standard.packages" value="mono-3.5,mono-1.0"
      unless="${platform::is-windows()}"/>

  <!-- Our standard package for general distribution -->
  <property name="default.package.config" value="net-3.5" />

  <!-- Options for runing the NUnit tests -->
  <property name="nunit.options" value=""/>

<!-- ***************************************************************** -->
<!-- **********Set Properties used by Various targets **************** -->
<!-- ***************************************************************** -->

  <!-- Project base dir is nant project base dir -->
  <property name="project.base.dir"
    value="${project::get-base-directory()}"/>

  <!-- Other directories are derived from base dir -->
  <property name="project.build.dir" 
    value="${path::combine(project.base.dir,'builds')}"/>
  <property name="project.package.dir" 
    value="${path::combine(project.base.dir,'packages')}"/>
  <property name="project.src.dir"
    value="${path::combine(project.base.dir, 'src')}"/>
  <property name="project.doc.dir"
    value="${path::combine(project.base.dir,'doc')}"/>
  <property name="project.samples.dir"
    value="${path::combine(project.base.dir,'samples')}"/>
  <property name="project.solutions.dir"
    value="${path::combine(project.base.dir,'solutions')}"/>
  <property name="project.tools.dir"
    value="${path::combine(project.base.dir,'tools')}"/>
  <property name="project.lib.dir"
    value="${path::combine(project.base.dir,'lib')}"/>
  <property name="project.install.dir"
    value="${path::combine(project.base.dir, 'install')}"/>

  <!-- Set paths to various package directories -->
  <property name="package.working.dir" 
    value="${path::combine(project.package.dir,package.base.name)}"/>
  <property name="package.bin.dir" 
    value="${path::combine(package.working.dir,'bin')}"/>
  <property name="package.doc.dir" 
    value="${path::combine(package.working.dir,'doc')}"/>
  <property name="package.samples.dir" 
    value="${path::combine(package.working.dir,'samples')}"/>
  <property name="package.src.dir" 
    value="${path::combine(package.working.dir,'src')}"/>
  <property name="package.lib.dir" 
    value="${path::combine(package.working.dir,'lib')}"/>
  <property name="package.solutions.dir"
    value="${path::combine(package.working.dir,'solutions')}"/>
  <property name="package.tools.dir"
    value="${path::combine(package.working.dir,'tools')}"/>
  <property name="package.resource.dir"
    value="${path::combine(package.working.dir,'resources')}"/>
  <property name="package.install.dir"
    value="${path::combine(package.working.dir,'install')}"/>

  <property name="build.defines" value=""/>

  <!-- sdk-exists causes an error if the framework is not installed! -->
  <!-- Default runtime configuration -->
  <foreach item="String" delim="," 
      property="framework" in="${supported.frameworks}">
    <if test="${framework::exists( framework )}">
      <property name="installed.frameworks" value="${installed.frameworks},${framework}"
        if="${property::exists('installed.frameworks')}"/>
      <property name="installed.frameworks" value="${framework}"
        unless="${property::exists('installed.frameworks')}"/>
      <if test="${framework::sdk-exists( framework )}">
        <property name="installed.sdks" value="${installed.sdks},${framework}"
          if="${property::exists('installed.sdks')}"/>
        <property name="installed.sdks" value="${framework}"
          unless="${property::exists('installed.sdks')}"/>
        <property name="default.runtime" value="${framework}"
          unless="${property::exists('default.runtime')}"/>
        <property name="default.net.runtime" value="${framework}"
          if="${string::starts-with(framework,'net')}"
          unless="${property::exists('default.net.runtime')}"/>
        <property name="default.mono.runtime" value="${framework}"
          if="${string::starts-with(framework,'mono')}"
          unless="${property::exists('default.mono.runtime')}"/>
      </if>
    </if>
  </foreach>

  <call target="set-${default.runtime}-runtime-config" />

  <call target="set-default-package-config" />

</target>

<!-- ***************************************************************** -->
<!-- ***    Targets for setting the runtime configuration          *** -->
<!-- ***************************************************************** -->

  <target name="set-runtime-config">   

    <property name="runtime.config" value="${default.runtime}"
      unless="${property::exists('runtime.config')}"/>

    <call target="check-sdk-exists"/>

    <call target="set-${runtime.config}-runtime-config"/>

    <property name="nant.settings.currentframework" value="${runtime.config}"/>

  </target>
  
  <target name="set-default-dot-net-runtime-config">

    <fail unless="${property::exists( 'default.net.runtime' )}"
      message="No versions of the .NET SDK were found"/>

    <call target="set-${default.net.runtime}-runtime-config" />

  </target>

  <target name="set-default-mono-runtime-config">

    <fail unless="${property::exists( 'default.mono.runtime' )}"
      message="No versions of the Mono runtime were found"/>

    <call target="set-${default.mono.runtime}-runtime-config" />

  </target>

  <target name="set-net-1.0-runtime-config">

    <property name="runtime.platform" value="net"/>
    <property name="runtime.version" value="1.0"/>
    <property name="target.version" value="1.0"/>
    <property name="runtime.defines" value="MSNET,CLR_1_0,NET_1_0"/>
    <property name="supported.test.platforms" 
      value="net-1.0,net-1.1,net-2.0,mono-1.0,mono-2.0"/>

  </target>
	
  <target name="set-net-1.1-runtime-config">

    <property name="runtime.platform" value="net"/>
    <property name="runtime.version" value="1.1"/>
    <property name="target.version" value="1.1"/>
    <property name="runtime.defines" value="MSNET,CLR_1_1,NET_1_1"/>
    <property name="supported.test.platforms"
      value="net-1.0,net-1.1,net-2.0,mono-1.0,mono-2.0"/>

  </target>
	
  <target name="set-net-2.0-runtime-config">

    <property name="runtime.platform" value="net"/>
    <property name="runtime.version" value="2.0"/>
    <property name="target.version" value="2.0"/>
    <property name="runtime.defines" value="MSNET,CLR_2_0,NET_2_0"/>
    <property name="supported.test.platforms" value="net-2.0,mono-2.0"/>

  </target>
   
  <target name="set-net-3.5-runtime-config">

    <property name="runtime.platform" value="net"/>
    <property name="runtime.version" value="3.5"/>
    <property name="target.version" value="2.0"/>
    <property name="runtime.defines" value="MSNET,CLR_2_0,NET_3_5,CS_3_0"/>
    <property name="supported.test.platforms" value="net-3.5,mono-3.5"/>

  </target>
 	
  <target name="set-net-4.0-runtime-config">

    <property name="runtime.platform" value="net"/>
    <property name="runtime.version" value="4.0"/>
    <property name="target.version" value="2.0"/>
    <property name="runtime.defines" value="MSNET,CLR_4_0,NET_4_0,CS_4_0"/>
    <property name="supported.test.platforms" value="net-4.0"/>

  </target>
 	
  <target name="set-mono-1.0-runtime-config">

    <property name="runtime.platform" value="mono"/>
    <property name="runtime.version" value="1.0"/>
    <property name="target.version" value="1.0"/>
    <property name="runtime.defines" value="MONO,NET_1_1"/>
    <property name="supported.test.platforms"
      value="mono-1.0,mono-2.0,net-1.0,net-1.1,net-2.0"/>

  </target>

  <target name="set-mono-2.0-runtime-config">

    <property name="runtime.platform" value="mono"/>
    <property name="runtime.version" value="2.0"/>
    <property name="target.version" value="2.0"/>
    <property name="runtime.defines" value="MONO,CLR_2_0,NET_2_0"/>
    <property name="supported.test.platforms" value="mono-2.0,net-2.0"/>

  </target>

  <target name="set-mono-3.5-runtime-config">

    <property name="runtime.platform" value="mono"/>
    <property name="runtime.version" value="3.5"/>
    <property name="target.version" value="2.0"/>
    <property name="runtime.defines" value="MONO,CLR_2_0,NET_3_5,CS_3_0"/>
    <property name="supported.test.platforms" value="mono-3.5,net-3.5,mono-2.0,net-2.0"/>

  </target>

<!-- ***************************************************************** -->
<!-- ***    Targets for setting the package configuration          *** -->
<!-- ***************************************************************** -->

  <target name="set-package-config">   
    <call target="set-${package.config}-package-config"/>
  </target>

  <target name="set-default-package-config">
    <call target="set-${default.package.config}-package-config"/>
  </target>

  <target name="set-net-3.5-package-config">
    <property name="package.config" value="net-3.5"/>
  </target>

  <target name="set-net-2.0-package-config">
    <property name="package.config" value="net-2.0"/>
  </target>

  <target name="set-net-1.1-package-config">
    <property name="package.config" value="net-1.1"/>
  </target>

<!-- ***************************************************************** -->
<!-- **************** Internally used targets ************************ -->
<!-- ***************************************************************** -->

  <!-- Check that current runtime is installed -->
  <target name="check-runtime-exists">

    <fail unless="${framework::exists(runtime.config)}"
      message="The ${runtime.config} runtime is not installed"/>

  </target>

  <!-- Check that current runtime sdk is installed -->
  <target name="check-sdk-exists" depends="check-runtime-exists">

    <fail unless="${framework::sdk-exists(runtime.config)}"
      message="The ${runtime.config} SDK is not configured or not installed"/>

  </target>

  <!-- Set up the build directory -->
  <target name="set-build-dir" depends="set-runtime-config">

    <property name="build.config" value="debug" 
      unless="${property::exists('build.config')}"/>

    <property name="runtime.platform.dir"
      value="${path::combine(project.build.dir,runtime.platform)}"/>
    <property name="runtime.version.dir"
      value="${path::combine(runtime.platform.dir,runtime.version)}"/>
    <property name="current.build.dir" 
      value="${path::combine(runtime.version.dir,build.config)}"/>
    <property name="current.lib.dir" 
      value="${path::combine(current.build.dir,'lib')}"/>
    <property name="current.test.dir" 
      value="${path::combine(current.build.dir,'tests')}"/>
    <property name="current.framework.dir" 
      value="${path::combine(current.build.dir,'framework')}"/>

<!--    <property name="package.bin.dir" 
      value="${path::combine(package.working.dir,runtime.config)}"/>-->
  </target>
  
  <target name="make-build-dir" depends="set-build-dir">
    <mkdir dir="${current.build.dir}"
      unless="${directory::exists(current.build.dir)}"/>
    <mkdir dir="${current.lib.dir}"
      unless="${directory::exists(current.lib.dir)}"/>
    <mkdir dir="${current.framework.dir}"
      unless="${directory::exists(current.framework.dir)}"/>
    <mkdir dir="${current.test.dir}"
      unless="${directory::exists(current.test.dir)}"/>
  </target>

<!-- ***************************************************************** -->
<!-- ***               Display Today's Build Number                *** -->
<!-- ***************************************************************** -->

  <target name="build-number">
    <echo message="Today's build number is ${package.build.number}"/>
  </target>

<!-- ***************************************************************** -->
<!-- ***           Dump configuration settings for debugging       *** -->
<!-- ***************************************************************** -->

  <target name="dump-settings" depends="set-build-dir">

    <echo>Project Directories</echo>
    <echo>  Base:      ${project.base.dir}</echo>
    <echo>   Doc:      ${project.doc.dir}</echo>
    <echo>   Samples:  ${project.samples.dir}</echo>
    <echo>   Source:   ${project.src.dir}</echo>
    <echo>   Build:    ${project.build.dir}</echo>
    <echo>   Package:  ${project.package.dir}</echo>
    <echo>   Tools:    ${project.tools.dir}</echo>
    <echo></echo>
    <echo>Runtimes Supported:</echo>
    <echo>  ${supported.frameworks}</echo>
    <echo>Runtimes Installed:</echo>
    <echo>  ${installed.frameworks}</echo>
    <echo>Framework SDKs Installed:</echo>
    <echo>  ${installed.sdks}</echo>
    <echo></echo>
    <if test="${property::exists('default.net.runtime')}">
    <echo>Default .Net Runtime: ${default.net.runtime}</echo>
    </if>
    <if test="${not property::exists('default.net.runtime')}">
    <echo>Default .Net Runtime: (none)</echo>
    </if>
    <if test="${property::exists('default.mono.runtime')}">
    <echo>Default Mono Runtime: ${default.mono.runtime}</echo>
    </if>
    <if test="${not property::exists('default.mono.runtime')}">
    <echo>Default Mono Runtime: (none)</echo>
    </if>
    <echo>     General Default: ${default.runtime}</echo>
    <echo></echo>
    <echo>Current Build Info</echo>
    <echo>  Config:    ${build.config}</echo>
    <echo>  Runtime:   ${runtime.config}</echo>
    <echo>  Build Dir: ${current.build.dir}</echo>
    <echo>  Defines:   ${build.defines}</echo>
    <echo></echo>
    <echo>Test Platforms for Current Build</echo>
    <echo>  Supported: ${supported.test.platforms}</echo>
    <echo></echo>
    <echo>Packaging</echo>
    <echo>  Base Name: ${package.base.name}</echo>
    <echo>  Version:   ${package.version}</echo>
    <echo>  Work Dir:  ${package.working.dir}</echo>
    <echo>   Bin:      ${package.bin.dir}</echo>
    <echo>   Doc:      ${package.doc.dir}</echo>
    <echo>   Samples:  ${package.samples.dir}</echo>
    <echo>   Source:   ${package.src.dir}</echo>
    <echo></echo>
    <echo>Current Framework and SDK Directories</echo>
    <echo>  ${framework::get-framework-directory(framework::get-target-framework())}</echo>
    <echo>  ${framework::get-sdk-directory(framework::get-target-framework())}</echo>

  </target>

</project>