2
<project name="NUnit" default="build" basedir=".">
4
<!-- ***************************************************************** -->
5
<!-- **********Set Properties used by Various targets **************** -->
6
<!-- ***************************************************************** -->
8
<!-- Project src dir is nant project base dir -->
9
<property name="project.src.dir"
10
value="${project::get-base-directory()}"/>
12
<!-- Project base dir is the src dir's parent -->
13
<property name="project.base.dir"
14
value="${path::get-directory-name(project.src.dir)}"/>
16
<!-- Other directories are derived from src and base -->
17
<property name="project.build.dir"
18
value="${path::combine(project.base.dir,'build')}"/>
19
<property name="project.package.dir"
20
value="${path::combine(project.base.dir,'package')}"/>
21
<property name="project.doc.dir"
22
value="${path::combine(project.base.dir,'doc')}"/>
23
<property name="project.samples.dir"
24
value="${path::combine(project.base.dir,'samples')}"/>
25
<property name="project.tools.dir"
26
value="${path::combine(project.base.dir,'tools')}"/>
28
<!-- Package directories -->
29
<property name="package.working.dir"
30
value="${path::combine(project.package.dir,package.name)}"/>
31
<property name="package.bin.dir"
32
value="${path::combine(package.working.dir,'bin')}"/>
33
<property name="package.doc.dir"
34
value="${path::combine(package.working.dir,'doc')}"/>
35
<property name="package.samples.dir"
36
value="${path::combine(package.working.dir,'samples')}"/>
37
<property name="package.src.dir"
38
value="${path::combine(package.working.dir,'src')}"/>
39
<property name="package.tools.dir"
40
value="${path::combine(package.working.dir,'tools')}"/>
41
<property name="package.resource.dir"
42
value="${path::combine(package.working.dir, 'resources')}"/>
44
<!-- Default build configuration -->
45
<property name="build.config" value="debug"/>
46
<property name="build.defines" value=""/>
48
<!-- Default runtime configuration -->
49
<foreach item="String" delim=","
50
property="framework" in="${supported.frameworks}">
51
<if test="${framework::sdk-exists( framework )}">
52
<property name="installed.frameworks" value="${installed.frameworks},${framework}"
53
if="${property::exists('installed.frameworks')}"/>
54
<property name="installed.frameworks" value="${framework}"
55
unless="${property::exists('installed.frameworks')}"/>
56
<property name="default.runtime" value="${framework}"
57
unless="${property::exists('default.runtime')}"/>
58
<property name="default.net.runtime" value="${framework}"
59
if="${string::starts-with(framework,'net')}"
60
unless="${property::exists('default.net.runtime')}"/>
61
<property name="default.mono.runtime" value="${framework}"
62
if="${string::starts-with(framework,'mono')}"
63
unless="${property::exists('default.mono.runtime')}"/>
67
<call target="set-${default.runtime}-runtime-config" />
69
<!-- ***************************************************************** -->
70
<!-- ********* Targets for setting the build configuration *********** -->
71
<!-- ***************************************************************** -->
73
<target name="set-build-config" description="Set the build config">
74
<call target="set-${build.config}-build-config"/>
77
<target name="set-debug-build-config">
78
<property name="build.config" value="debug"/>
79
<property name="build.debug" value="true"/>
80
<property name="build.defines" value="DEBUG,TRACE,${runtime.defines}"
82
<property name="build.suffix" value="-dbg"/>
85
<target name="set-release-build-config">
86
<property name="build.config" value="release"/>
87
<property name="build.debug" value="false"/>
88
<property name="build.defines" value="TRACE,${runtime.defines}"
90
<property name="build.suffix" value=""/>
93
<!-- ***************************************************************** -->
94
<!-- *** Targets for setting the runtime configuration *** -->
95
<!-- ***************************************************************** -->
97
<target name="set-runtime-config">
98
<call target="set-${runtime.config}-runtime-config"/>
101
<target name="set-default-dot-net-runtime-config">
102
<fail unless="${property::exists( 'default.net.runtime' )}"
103
message="No versions of the .NET SDK were found"/>
105
<call target="set-${default.net.runtime}-runtime-config" />
108
<target name="set-default-mono-runtime-config">
109
<fail unless="${property::exists( 'default.mono.runtime' )}"
110
message="No versions of the Mono runtime were found"/>
112
<call target="set-${default.mono.runtime}-runtime-config" />
115
<target name="set-net-1.0-runtime-config">
116
<fail unless="${framework::sdk-exists( 'net-1.0' )}"
117
message="The .NET 1.0 SDK is not configured or not installed"/>
119
<property name="runtime.platform" value="net"/>
120
<property name="runtime.version" value="1.0"/>
121
<property name="runtime.config" value="net-1.0"/>
122
<property name="runtime.defines" value="NET,NET_1_0"/>
123
<property name="build.mono" value="false"/>
124
<property name="build.win32" value="true"/>
125
<property name="build.x86" value="false"/>
126
<property name="nant.settings.currentframework"
128
<property name="supported.test.platforms"
129
value="net-1.0,net-1.1,net-2.0,mono-1.0,mono-2.0"/>
132
<target name="set-net-1.1-runtime-config">
133
<property name="runtime.platform" value="net"/>
134
<fail unless="${framework::sdk-exists( 'net-1.1' )}"
135
message="The .NET 1.1 SDK is not configured or not installed"/>
137
<property name="runtime.platform" value="net"/>
138
<property name="runtime.version" value="1.1"/>
139
<property name="runtime.config" value="net-1.1"/>
140
<property name="runtime.defines" value="NET,NET_1_1"/>
141
<property name="build.mono" value="false"/>
142
<property name="build.win32" value="true"/>
143
<property name="build.x86" value="false"/>
144
<property name="nant.settings.currentframework"
146
<property name="supported.test.platforms"
147
value="net-1.0,net-1.1,net-2.0,mono-1.0,mono-2.0"/>
150
<target name="set-net-2.0-runtime-config">
151
<fail unless="${framework::sdk-exists( 'net-2.0' )}"
152
message="The .NET 2.0 SDK is not configured or not installed"/>
154
<property name="runtime.platform" value="net"/>
155
<property name="runtime.version" value="2.0"/>
156
<property name="runtime.config" value="net-2.0"/>
157
<property name="runtime.defines" value="NET,NET_2_0"/>
158
<property name="build.mono" value="false"/>
159
<property name="build.win32" value="true"/>
160
<property name="build.x86" value="true"/>
161
<property name="nant.settings.currentframework"
163
<property name="supported.test.platforms" value="net-2.0,mono-2.0"/>
166
<target name="set-mono-1.0-runtime-config">
167
<fail unless="${framework::sdk-exists( 'mono-1.0' )}"
168
message="The Mono 1.0 SDK is not configured or not installed"/>
170
<property name="runtime.platform" value="mono"/>
171
<property name="runtime.version" value="1.0"/>
172
<property name="runtime.config" value="mono-1.0"/>
173
<property name="runtime.defines" value="MONO,MONO_1_0"/>
174
<property name="build.mono" value="true"/>
175
<property name="build.win32" value="false"/>
176
<property name="build.x86" value="false"/>
177
<property name="nant.settings.currentframework"
179
<property name="supported.test.platforms"
180
value="mono-1.0,mono-2.0,net-1.0,net-1.1,net-2.0"/>
183
<target name="set-mono-2.0-runtime-config">
184
<fail unless="${framework::sdk-exists( 'mono-2.0' )}"
185
message="The Mono 2.0 SDK is not configured or not installed"/>
187
<property name="runtime.platform" value="mono"/>
188
<property name="runtime.version" value="2.0"/>
189
<property name="runtime.config" value="mono-2.0"/>
190
<property name="runtime.defines" value="MONO,MONO_2_0"/>
191
<property name="build.mono" value="true"/>
192
<property name="build.win32" value="false"/>
193
<property name="build.x86" value="true"/>
194
<property name="nant.settings.currentframework"
196
<property name="supported.test.platforms" value="mono-2.0,net-2.0"/>
199
<!-- ***************************************************************** -->
200
<!-- **************** Internally used targets ************************ -->
201
<!-- ***************************************************************** -->
203
<!-- Set up the build directory -->
204
<target name="set-build-dir"
205
depends="set-build-config,set-runtime-config">
206
<property name="runtime.platform.dir"
207
value="${path::combine(project.build.dir,runtime.platform)}"/>
208
<property name="runtime.version.dir"
209
value="${path::combine(runtime.platform.dir,runtime.version)}"/>
210
<property name="current.build.dir"
211
value="${path::combine(runtime.version.dir,build.config)}"/>
214
<target name="make-build-dir" depends="set-build-dir">
215
<mkdir dir="${current.build.dir}"
216
unless="${directory::exists(current.build.dir)}"/>
219
<!-- ***************************************************************** -->
220
<!-- *** Dump configuration settings for debugging *** -->
221
<!-- ***************************************************************** -->
223
<target name="dump-settings" depends="set-build-dir">
225
<echo>Project Directories</echo>
226
<echo> Base: ${project.base.dir}</echo>
227
<echo> Doc: ${project.doc.dir}</echo>
228
<echo> Samples: ${project.samples.dir}</echo>
229
<echo> Source: ${project.src.dir}</echo>
230
<echo> Install: ${project.install.dir}</echo>
231
<echo> Build: ${project.build.dir}</echo>
232
<echo> Package: ${project.package.dir}</echo>
233
<echo> Tools: ${project.tools.dir}</echo>
235
<echo>Runtime Versions</echo>
236
<echo> Supported: ${supported.frameworks}</echo>
237
<echo> Installed: ${installed.frameworks}</echo>
238
<echo> Default: ${default.runtime}</echo>
239
<echo> .Net: ${default.net.runtime}</echo>
240
<echo> Mono: ${default.mono.runtime}</echo>
242
<echo>Current Build Settings</echo>
243
<echo> Config: ${build.config}</echo>
244
<echo> Runtime: ${runtime.config}</echo>
245
<echo> Build Dir: ${current.build.dir}</echo>
246
<echo> Defines: ${build.defines}</echo>
248
<echo>Test Platforms for Current Build</echo>
249
<echo> Supported: ${supported.test.platforms}</echo>
251
<echo>Packaging</echo>
252
<echo> Name: ${package.name}</echo>
253
<echo> Version: ${package.version}</echo>
254
<echo> Work Dir: ${package.working.dir}</echo>
255
<echo> Bin: ${package.bin.dir}</echo>
256
<echo> Doc: ${package.doc.dir}</echo>
257
<echo> Samples: ${package.samples.dir}</echo>
258
<echo> Source: ${package.src.dir}</echo>
260
<echo>Current Framework and SDK Directories</echo>
261
<echo> ${framework::get-framework-directory(framework::get-target-framework())}</echo>
262
<echo> ${framework::get-sdk-directory(framework::get-target-framework())}</echo>
b'\\ No newline at end of file'