Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nunitlite.build - github.com/mono/guiunit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0838fc940e35b371389a0a8f912be83962731b4c (plain)
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
<?xml version="1.0"?>
<project name="NUnit" default="help" basedir=".">

<!-- ***************************************************************** -->
<!-- This script has been tested using NAnt 0.92. At least             -->
<!-- one of the supported runtimes and sdk must be installed. In       -->
<!-- order to build the msi, WiX 2.0 and the WiX tasks for NAnt        -->
<!-- are required. To run the test coverage target, NCover is          -->
<!-- required.                                                         -->
<!-- ***************************************************************** -->
<!-- TODO: Edit above to reflect actual targets -->

<!-- ***************************************************************** -->
<!-- ***                 Default Help Target                       *** -->
<!-- ***************************************************************** -->

<target name="help">
  <echo>
This build file will build NUnitLite for any of the supported
runtime frameworks which are actually installed. To add support
for a framework, edit this script

Running on the current system, the following runtime frameworks
are available for building and testing NUnit:
  </echo>

  <foreach item="String" delim="," 
      property="framework" in="${installed.frameworks}">
    <echo message="    ${string::pad-right(framework,18,' ')}${framework::get-description(framework)}"/>
  </foreach>

  <echo>
Note that targets that set the build configuration or runtime
to be used must come before action targets. For example:

    nant net-2.0 release build
    nant build-all
    nant debug clean build

Use   nant -projecthelp to see a full list of targets.
  </echo>
</target>

<!-- ***************************************************************** -->
<!-- ********* Common properties that control the build ************** -->
<!-- ***************************************************************** -->
 
  <!-- Project name - used as a prefix for packages -->
  <property name="project.name" value="NUnitLite"/>

  <!-- NUnit version for packaging -->
  <property name="package.version" value="0.9.0"/>

  <!-- Additional suffix used to distinguish files with the same version -->
  <property name="package.suffix" value=""/>

  <!-- 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="0.9.0" />

  <!-- Frameworks supported by this build script -->
  <property name="supported.frameworks"
    value="net-1.1,net-2.0,net-3.5,net-4.0,net-4.5,netcf-2.0,netcf-3.5,mono-2.0,mono-3.5,mono-4.0,silverlight-3.0,silverlight-4.0,silverlight-5.0"/>

  <!-- Framework versions for which packages are normally created -->
  <property name="standard.packages"
    value="net-1.1,net-2.0,net-3.5,net-4.0,net-4.5,netcf-2.0,netcf-3.5,silverlight-3.0,silverlight-4.0,silverlight-5.0" />

  <!-- Additional internal properties are set in the include file -->
  <include buildfile="nunitlite.build.include"/>


<!-- ***************************************************************** -->
<!-- ***          Targets that set the build configuration         *** -->
<!-- ***     These must come before actions like build or test     *** -->
<!-- ***************************************************************** -->

  <target name="debug" description="Set config to debug for commands that follow">
    <call target="set-debug-build-config" />
  </target>

  <target name="release" description="Set config to release for commands that follow">
    <call target="set-release-build-config" />
  </target>

<!-- ***************************************************************** -->
<!-- ***         Targets that set the runtime configuration        *** -->
<!-- ***     These must come before actions like build or test     *** -->
<!-- ***************************************************************** -->

  <target name="net-1.1" 
    description="Set runtime to .NET 1.1 for targets that follow"
    depends="set-net-1.1-runtime-config"/>
      
  <target name="net-2.0" 
    description="Set runtime to .NET 2.0 for targets that follow"
    depends="set-net-2.0-runtime-config"/>
      
  <target name="net-3.5"
    description="Set runtime to .NET 3.5 for targets that follow"
    depends="set-net-3.5-runtime-config"/>

  <target name="net-4.0"
    description="Set runtime to .NET 4.0 for targets that follow"
    depends="set-net-4.0-runtime-config"/>

  <target name="net-4.5"
    description="Set runtime to .NET 4.5 for targets that follow"
    depends="set-net-4.5-runtime-config"/>

  <target name="netcf-2.0" 
    description="Set runtime to .NET CF 2.0 for targets that follow"
    depends="set-netcf-2.0-runtime-config"/>
      
  <target name="netcf-3.5" 
    description="Set runtime to .NET CF 3.5 for targets that follow"
    depends="set-netcf-3.5-runtime-config"/>
      
  <target name="mono-2.0"
    description="Set runtime to Mono 2.0 for targets that follow"
    depends="set-mono-2.0-runtime-config"/>

  <target name="mono-3.5"
    description="Set runtime to Mono 3.5 for targets that follow"
    depends="set-mono-3.5-runtime-config"/>

  <target name="mono-4.0"
    description="Set runtime to Mono 4.0 for targets that follow"
    depends="set-mono-4.0-runtime-config"/>

  <target name="sl-3.0"
    description="Set runtime to Silverlight 3.0 for targets that follow"
    depends="set-silverlight-3.0-runtime-config"/>

  <target name="sl-4.0"
    description="Set runtime to Silverlight 4.0 for targets that follow"
    depends="set-silverlight-4.0-runtime-config"/>

  <target name="sl-5.0"
    description="Set runtime to Silverlight 5.0 for targets that follow"
    depends="set-silverlight-5.0-runtime-config"/>

<!-- ***************************************************************** -->
<!-- ***             Targets that clean directories                *** -->
<!-- ***************************************************************** -->

  <target name="clean" depends="set-build-dir"
      description="Removes the current build directory">

    <property name="current.target" value="clean"/>
    <call target="run-subprojects"/>

  </target>

  <target name="clean-all" description="Removes all build directories">
    <delete dir="${project.build.dir}" 
      if="${directory::exists( project.build.dir )}"/>
  </target>

  <target name="clean-package-dir"
    description="Removes the current package working directory">
        <delete dir="${package.working.dir}" 
            if="${directory::exists( package.working.dir )}"/>
  </target>

  <target name="clean-source-dirs">
    <delete>
      <fileset>
        <include name="*/*/obj/**/*"/>
        <include name="*/*/bin/**/*"/>
      </fileset>
    </delete>
  </target>
.
<!-- ***************************************************************** -->
<!-- ***              Targets that perform builds                  *** -->
<!-- ***************************************************************** -->

  <target name="build" depends="make-build-dir"
    description="Build NUnit for default runtime version and config">

    <echo message="*"/>
    <echo message="* Starting ${runtime.config} ${build.config} build"/>
    <echo message="* Current Build Directory = ${current.build.dir}"/>
    <echo message="*"/>

    <property name="nant.settings.currentframework" value="${build.framework}"/>

    <property name="current.target" value="build"/>
    <call target="run-subprojects"/>

  </target>

  <target name="build-all"
      description="Build current config for all available runtimes">
    <foreach item="String" delim="," 
        property="framework" in="${installed.frameworks}">
      <call target="set-${framework}-runtime-config"/>
      <call target="build"/>
    </foreach>
  </target>

  <target name="rebuild" depends="make-build-dir"
    description="Rebuild NUnit for default runtime version and config">

    <echo message="*"/>
    <echo message="* Starting ${runtime.config} ${build.config} rebuild"/>
    <echo message="* Current Build Directory = ${current.build.dir}"/>
    <echo message="*"/>

    <property name="nant.settings.currentframework" value="${build.framework}"/>

    <property name="current.target" value="rebuild"/>
    <call target="run-subprojects"/>

  </target>

  <target name="rebuild-all" depends="clean-all,build-all"
      description="Rebuild current config for all available runtimes">
    <foreach item="String" delim="," 
        property="framework" in="${installed.frameworks}">
      <call target="set-${framework}-runtime-config"/>
      <call target="rebuild"/>
    </foreach>
  </target>

<!-- ***************************************************************** -->
<!-- ***                 Targets for running tests                 *** -->
<!-- ***************************************************************** -->

  <target name="test" depends="build"
    description="Build and run tests for selected config and runtime">

    <call target="run-test" unless="${runtime.platform == 'silverlight'}"/>
    <call target="run-silverlight-test" if="${runtime.platform == 'silverlight'}"/>

  </target>

  <target name="ci-test" depends="build"
    description="Build and run CI test (no gui) for selected config and runtime">

    <call target="run-test" unless="${runtime.platform == 'silverlight'}"/>
    <call target="run-silverlight-ci-test" if="${runtime.platform == 'silverlight'}"/>

  </target>

  <target name="run-test"
      description="Run tests for selected config and runtime (no rebuild)">

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

    <echo message="*"/>
    <echo message="* Testing ${runtime.config} ${build.config} build"/>
    <echo message="*"/>

    <exec basedir="${current.build.dir}"
      workingdir="${current.build.dir}" 
      program="nunitlite.tests.exe" 
      managed="Strict"/>

  </target>

  <target name="run-silverlight-test">

    <property name="xap.file.name" value="nunitlite.tests-${msbuild.proj.suffix}.xap"/>

    <exec program="sllauncher.exe"
          basedir="C:\Program Files\Microsoft Silverlight"
          workingdir="${current.build.dir}">
      
      <arg value="/emulate:${xap.file.name}"/>
      <arg value="/origin:file://TestPage.html"/>

    </exec>

  </target>

  <target name="run-silverlight-ci-test">

    <echo message="*"/>
    <echo message="* Testing ${runtime.config} ${build.config} build"/>
    <echo message="*"/>

    <exec basedir="${current.build.dir}"
      workingdir="${current.build.dir}" 
      program="ci-test-runner.exe" 
      commandline="nunitlite.tests"
      managed="Strict"/>

  </target>

  <target name="test-all"
      description="Build and test all runtimes for current config">
	  
    <foreach item="String" delim="," 
        property="framework" in="${installed.frameworks}">
      <call target="set-${framework}-runtime-config"/>
      <call target="test" />
    </foreach>
	  
  </target>

<!-- ***************************************************************** -->
<!-- ***       Targets for packaging the NUnitLite distribution    *** -->
<!-- ***************************************************************** -->

  <target name="package" description="Create package for a release">

    <call target="package-bins"/>
    <call target="package-src"/>

  </target>

  <target name="package-bins" depends="clean-package-dir"
    description="Package binaries for all supported frameworks">

    <foreach item="String" delim="," 
        property="framework" in="${standard.packages}">

      <if test="${framework::exists(framework)}">
        <if test="${string::starts-with(framework, 'silverlight') or framework::sdk-exists(framework)}">
          <call target="set-${framework}-runtime-config"/>
          <call target="package-build"/>
        </if>
      </if>

    </foreach>

    <!-- Create the zip file -->
    <zip zipfile="${project.package.dir}/${package.name}.zip" ziplevel="9">
      <fileset basedir="${package.working.dir}" prefix="${package.name}">
        <include name="**"/>
      </fileset>
    </zip>

    <!-- Create the NuGet package -->
    <exec program="NuGet.exe"
          commandline="pack NUnitLite.nuspec -OutputDirectory package -Version ${package.version}"
          workingdir="."/>

  </target>

  <target name="package-build" depends="build"
    description="Helper that packages the binaries for a single build">

    <copy todir="${package.working.dir}/${runtime.config}">
      <fileset basedir="${current.build.dir}">
        <include name="*"/>
      </fileset>
    </copy>

  </target>

  <target name="package-src" depends="clean-package-dir"
    description="Create full source package for developer use">

    <copy todir="${package.working.dir}">
      <fileset basedir="${project.base.dir}">
        <include name="README.txt"/>
        <include name="CHANGES.txt"/>
        <include name="LICENSE.txt"/>
        <include name="nant.bat"/>
        <include name="nunitlite.build"/>
        <include name="nunitlite.build.include"/>
        <include name="NUnitLite.nuspec"/>
        <include name="NUnitLite.sln"/>
        <include name="NUnitLiteCF.sln"/>
      </fileset>
    </copy>

    <call target="copy-src"/>
    <call target="copy-tools"/>

    <!-- Create the zip file -->
    <zip zipfile="${project.package.dir}/${package.name}-src.zip" ziplevel="9">
      <fileset basedir="${package.working.dir}" prefix="${package.name}">
        <include name="**"/>
      </fileset>
    </zip>

  </target>
  
</project>