forked from henon/GitSharp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.xml
370 lines (316 loc) · 19.5 KB
/
common.xml
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
<?xml version="1.0"?>
<project name="GitSharp" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<!--
Use this to determine if the key file CastleKey.snk should be used to
sign the assemblies. Defaults to true since private key is present
in SVN.
-->
<property name="sign" value="true" overwrite="false" />
<!-- Controls whether tests are run. Setting this is as input to the build disables *all* tests. -->
<property name="common.run-tests" value="true" overwrite="false" />
<property name="common.testrunner.enabled" value="${common.run-tests}" overwrite="false" />
<property name="common.testrunner.failonerror" value="true" overwrite="false" /> <!-- Whether to keep building when tests are failing -->
<property name="common.coverage.enabled" value="false" overwrite="false" /><!-- Controls whether tests will be run under NCover to generate coverage logs -->
<!-- Build platforms (used to conditionally disable specific projects for specific platforms) -->
<property name="common.net-2.0" value="${nant.settings.currentframework == 'net-2.0'}" />
<property name="common.silverlight" value="${nant.settings.currentframework == 'silverlight-2.0'}" />
<property name="common.mono" value="${framework::get-family(framework::get-runtime-framework()) == 'mono'}" />
<!-- Check which nant version we're using - fail if it's not the minium -->
<property name="nant-version.current" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />
<property name="nant-version.required" value="0.85.2478.0" /> <!-- Nant 0.85 release version -->
<property name="nant-version.beta1_086" value="0.86.2898.0" /> <!-- Nant 0.86 Beta 1 -->
<!-- properties used to connect to database for testing -->
<property name="ar.dialect" value="NHibernate.Dialect.MsSql2000Dialect" overwrite="false" />
<property name="ar.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" overwrite="false" />
<property name="ar.connection.connection_string.1" value="Server=(local);initial catalog=test;Integrated Security=SSPI" overwrite="false" />
<property name="ar.connection.connection_string.2" value="Server=(local);initial catalog=test2;Integrated Security=SSPI" overwrite="false" />
<!--
Path to the folder that contain the external assemblies. For net-2.0 the values will
be lib, lib/net, and lib/net/2.0 respectively.
-->
<property name="lib.dir" value="extern" dynamic="true" />
<property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" />
<if test="${nant-version.current != nant-version.beta1_086 or framework::get-target-framework() != 'net-3.5'}">
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />
</if>
<if test="${nant-version.current == nant-version.beta1_086 and framework::get-target-framework() == 'net-3.5'}">
<echo>Detected NAnt 0.86 Beta 1, consider upgrading to a newer version (a nightly build) when building for .NET 3.5</echo>
<echo>The latest NAnt nightly can be downloaded from http://nant.sourceforge.net/nightly/latest/nant-bin.zip</echo>
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, string::substring(framework::get-target-framework(), 4, 3))}" dynamic="true" />
</if>
<property name="lib.framework.clr.dir" value="${path::combine(lib.family.dir, string::substring(clr-version, 0, 3))}" dynamic="true" />
<!-- x64 support -->
<property name="lib.family-x64.dir" value="${path::combine(lib.family.dir, 'x64')}" dynamic="true" />
<property name="lib.framework-x64.dir" value="${path::combine(lib.framework.dir, 'x64')}" dynamic="true" />
<property name="lib.framework.clr-x64.dir" value="${path::combine(lib.framework.clr.dir, 'x64')}" dynamic="true" />
<if test="${not(framework::get-family(framework::get-runtime-framework()) == 'mono')}">
<property name="registry.dotnet.v3.0.Installed" value="0" overwrite="false"/>
<readregistry property="registry.dotnet.v3.0.Installed"
key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Install"
hive="LocalMachine"
failonerror="false" />
<readregistry property="registry.dotnet.v3.0.Installed"
key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\InstallSuccess"
hive="LocalMachine"
unless="${property::exists('registry.dotnet.v3.0.Installed')}"
failonerror="false" />
<property name="dotnet.v3.0.installed" value="${registry.dotnet.v3.0.Installed == '1'}" />
<if test="${dotnet.v3.0.installed}">
<readregistry property="dotnet.v3.0.ReferenceInstallPath"
key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Communication Foundation\ReferenceInstallPath"
hive="LocalMachine"
if="${dotnet.v3.0.installed}" />
</if>
</if>
<property name="dotnet.v3.0.installed" value="false" if="${framework::get-family(framework::get-runtime-framework()) == 'mono'}" />
<property name="dotnet.v3.0.ReferenceInstallPath" value="" unless="${dotnet.v3.0.installed}" />
<!--
Versioning
-->
<property name="project.version" value="1.1.0.0" overwrite="false" />
<property name="project.major" value="${version::get-major(version::parse(project.version))}" dynamic="true" />
<property name="project.minor" value="${version::get-minor(version::parse(project.version))}" dynamic="true" />
<property name="project.build" value="${version::get-build(version::parse(project.version))}" dynamic="true" />
<property name="project.revision" value="${svn.revision}" dynamic="true" />
<property name="assembly.major" value="${version::get-major(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.minor" value="${version::get-minor(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.build" value="${version::get-build(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.revision" value="${version::get-revision(version::parse(assembly.version))}" dynamic="true" />
<property name="svn.revision" value="0" overwrite="false" />
<!--
These are used to set the correct attributes in AssemblyInfo.cs.
-->
<property name="project.company" value="Castle Project" />
<!-- debug|release -->
<property name="build.defines" value="TRACE" />
<property name="build.defines" value="${build.defines},STRONG" if="${sign}" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- named project configurations -->
<target name="set-debug-project-configuration" description="Perform a 'debug' build">
<property name="build.debugoutput" value="Enable" />
<property name="build.optimize" value="false" overwrite="false" />
</target>
<target name="set-release-project-configuration" description="Perform a 'release' build">
<property name="build.debugoutput" value="Enable" />
<property name="build.optimize" value="true" overwrite="false" />
</target>
<target name="set-project-configuration">
<property name="project.config" value="debug" overwrite="false" />
<if test="${not(target::exists('set-' + project.config + '-project-configuration'))}">
<fail message="Unknown configuration: '${project.config}'" />
</if>
<property name="build.warnaserrors" value="true" overwrite="false" />
<property name="build.warnmissingdocs" value="false" overwrite="false" />
<call target="set-${project.config}-project-configuration" />
<property name="src.dir" value="${path::get-full-path(project::get-base-directory())}" />
<property name="build.base.dir" value="${path::get-full-path(root.dir)}/build" />
<property name="build.family.dir" value="${build.base.dir}/${nant.settings.currentframework}" />
<property name="build.dir" value="${path::get-full-path(path::combine(build.family.dir,project.config))}" dynamic="true" />
<property name="testresults.dir" value="${build.dir}/test-results" />
<property name="coverageresults.dir" value="${build.dir}/coverage-results" />
<property name="coveragereports.dir" value="${build.dir}/coverage-reports" />
<property name="releasenotes.dir" value="${build.dir}/ReleaseNotes" />
<property name="docs.dir" value="${build.base.dir}/docs" />
<property name="build.rebuild" value="false" overwrite="false" />
</target>
<target name="set-framework-configuration">
<if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-configuration'))}">
<fail message="The '${framework::get-target-framework()}' framework is not supported by this version of Castle." />
</if>
<property name="clr-version" value="${framework::get-clr-version(framework::get-runtime-framework())}" />
<property name="csc.keyfile" value="" />
<property name="csc.args" value="" />
<property name="common.testrunner.args" value="" overwrite="false" />
<if test="${not(framework::get-family(framework::get-runtime-framework()) == 'mono')}">
<readregistry property="dotnet.SPlevel"
key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v${framework::get-clr-version(framework::get-runtime-framework())}\SP"
hive="LocalMachine"
/>
</if>
<property name="dotnet.SPlevel" value="0" if="${framework::get-family(framework::get-runtime-framework()) == 'mono'}" />
<script language="C#">
<code>
<![CDATA[
public static void ScriptMain(Project project)
{
// Detect Process Bitness - http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx
if( System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86" && string.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))) {
project.Properties["os.x64"] = false.ToString();
} else {
project.Properties["os.x64"] = true.ToString();
}
}
]]>
</code>
</script>
<call target="set-${framework::get-target-framework()}-framework-configuration" />
<property name="build.msbuild" value="false" overwrite="false" />
</target>
<target name="set-net-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="net-2.0" />
<property name="current.build.defines" value="${build.defines},NET,DOTNET2" />
<property name="current.build.defines" value="${current.build.defines},DOTNET2SP1" if="${dotnet.SPlevel == '1'}" />
<property name="link.sdkdoc.version" value="SDK_v2_0" />
<property name="merge.targetplatform" value="v2" />
<!-- If DevEnvDir exists, we grab it, otherwise we try if the default location (if it exists) -->
<if test="${environment::variable-exists('DevEnvDir')}">
<property name="dev.env.dir" value="${environment::get-variable('DevEnvDir')}" />
</if>
<if test="${not environment::variable-exists('DevEnvDir')}">
<property name="default.dev.env.dir" value="%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE" />
<if test="${directory::exists(default.dev.env.dir)}">
<property name="dev.env.dir" value="${default.dev.env.dir}" />
</if>
</if>
<property name="build.msbuild" value="false" overwrite="false" />
<property name="project.vsproj" value="${project::get-name()}-vs2005.csproj" />
</target>
<target name="set-net-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="current.build.defines" value="${build.defines},NET,DOTNET35" />
<property name="link.sdkdoc.version" value="SDK_v3_5" />
<property name="merge.targetplatform" value="v3" />
<!-- If DevEnvDir exists, we grab it, otherwise we try if the default location (if it exists) -->
<if test="${environment::variable-exists('DevEnvDir')}">
<property name="dev.env.dir" value="${environment::get-variable('DevEnvDir')}" />
</if>
<if test="${not environment::variable-exists('DevEnvDir')}">
<property name="default.dev.env.dir" value="%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE" />
<if test="${directory::exists(default.dev.env.dir)}">
<property name="dev.env.dir" value="${default.dev.env.dir}" />
</if>
</if>
<property name="build.msbuild" value="false" overwrite="false" />
<property name="project.vsproj" value="${project::get-name()}-vs2008.csproj" />
</target>
<target name="set-silverlight-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="silverlight-2.0" />
<property name="current.build.defines" value="${build.defines},SILVERLIGHT" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="build.warnaserrors" value="false" />
<property name="build.msbuild" value="false" overwrite="false" />
</target>
<target name="set-mono-1.0-framework-configuration">
<property name="nant.settings.currentframework" value="mono-1.0" />
<property name="current.build.defines" value="${build.defines},MONO,MONO1" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<!-- mono puts gacutil on PATH -->
<property name="gacutil.file" value="gacutil" />
<property name="build.warnaserrors" value="false" />
</target>
<target name="set-mono-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="mono-2.0" />
<property name="current.build.defines" value="${build.defines},MONO,MONO2,DOTNET2" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<!-- mono puts gacutil on PATH -->
<property name="gacutil.file" value="gacutil" />
<property name="build.warnaserrors" value="false" />
</target>
<target name="set-mono-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="mono-3.5" />
<property name="current.build.defines" value="${build.defines},MONO,MONO2,DOTNET35" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="gacutil.file" value="gacutil" />
<property name="build.warnaserrors" value="false" />
<property name="build.msbuild" value="false" overwrite="false" />
</target>
<target name="display-current-runtime">
<echo message="" />
<echo message="----------------------------------------------------------" />
<echo message=" ${framework::get-description(framework::get-target-framework())}" />
<echo message="----------------------------------------------------------" />
<echo message="" />
<echo message="framework : ${framework::get-target-framework()}" />
<echo message="description : ${framework::get-description(framework::get-target-framework())}" />
<echo message="sdk directory : ${framework::get-sdk-directory(framework::get-target-framework())}" />
<echo message="framework directory : ${framework::get-framework-directory(framework::get-target-framework())}" />
<echo message="assembly directory : ${framework::get-assembly-directory(framework::get-target-framework())}" />
<echo message="runtime engine : ${framework::get-runtime-engine(framework::get-target-framework())}" />
<echo message="extra : .Net 3.0 installed" if="${dotnet.v3.0.installed}" />
<echo message="" />
</target>
<target name="common.init"
depends="common.check-nant-version common.find-tools set-framework-configuration set-project-configuration"
description="Initializes build properties">
<fileset id="project.sources" failonempty="true">
<include name="${src.dir}/**/*.cs" />
</fileset>
<resourcefileset id="project.resources" />
</target>
<target name="common.find-svninfo">
<!-- For adding SVN revision to builds -->
<property name="svn.revision" value="0" overwrite="false" />
<!-- try to update the revision -->
<exec
program="svn"
commandline='info "${project::get-base-directory()}" --xml'
output="_revision.xml"
failonerror="false"/>
<if test="${(framework::get-family(framework::get-runtime-framework()) == 'mono')}"> <!-- Should check unix not mono -->
<exec
program="svn"
commandline='info "${project::get-base-directory()}" --xml > _revision.xml'
failonerror="false"/>
</if>
<xmlpeek
file="_revision.xml"
xpath="/info/entry/@revision"
property="svn.revision"
failonerror="false"/>
<delete file="_revision.xml" failonerror="false" />
<echo message="INFO: Using Subversion revision number: ${svn.revision}"/>
</target>
<target name="common.find-nunit">
<if test="${not property::exists('nunit.found')}">
<property name="nunit.found" value="-1" />
<if test="${(framework::get-family(framework::get-runtime-framework()) == 'mono')}">
<exec
program="${nunit-console2}"
resultproperty="nunit.found"
output="_nunit.txt"
failonerror="false" />
<property name="nunit-console" value="${nunit-console2}" if="${nunit.found == '0'}" />
</if>
<exec unless="${nunit.found == '0'}"
program="${nunit-console}"
commandline="/help"
resultproperty="nunit.found"
output='_nunit.txt'
failonerror="false" />
<property name="nunit.found" value="${nunit.found == '0'}" readonly="true" />
<fail message="ERROR: NUnit not found, cannot continue." unless="${nunit.found}"/>
<if test="${nunit.found}"> <!-- Determine if we can use this version of NUnit -->
<loadfile file="_nunit.txt" property="nunit_txt" />
<delete file="_nunit.txt" failonerror="false" />
<property name="nunit_findtxt" value="NUnit version " />
<property name="nunit_version" value="" />
<if test="${string::index-of( nunit_txt, nunit_findtxt) >= 0}">
<property name="nunit_version" value="${string::trim(string::substring(nunit_txt, string::index-of( nunit_txt, nunit_findtxt) + string::get-length(nunit_findtxt),6 ))}" />
</if>
<echo if="${string::get-length(nunit_version) == 0}">WARNING: Unable to determine NUnit version, unit tests may fail unpredictably with your version of NUnit</echo>
<echo if="${string::get-length(nunit_version) > 0}">INFO: Found NUnit ${nunit_version} in ${nunit-console}</echo>
</if>
</if>
</target>
<target name="common.check-nant-version">
<fail if="${nant-version.current<nant-version.required}" message="Not using minimum required Nant version: ${nant-version.required} (current version: ${nant-version.current}). Please upgrade your copy of nant." />
</target>
<target name="common.find-tools">
<!-- Where is nunit-console executable(win/mono) ? -->
<property name="nunit-console2" value="nunit-console2" overwrite="false" />
<property name="nunit-console" value="${root.dir}/extern/nunit/nunit-console.exe" overwrite="false" />
<!-- Where is NCover? (on 64-bit Windows NAnt's get-folder-path() returns the x86 directory which is not what we want) -->
<property name="ncover.dir" value="C:\Program Files\NCover" overwrite="false" />
<!-- Where is NDepend -->
<property name="ndepend.dir" value="C:\Program Files\NDepend" overwrite="false" />
<!-- Where is WiX? -->
<property name="wix.dir" value="${environment::get-folder-path('ProgramFiles')}\Windows Installer XML v3\bin" overwrite="false" />
<!-- Where is Sandcastle Help File Builder (SHFB)? -->
<property name="shfb.dir" value="${environment::get-folder-path('ProgramFiles')}\EWSoftware\Sandcastle Help File Builder" overwrite="false" />
<!-- Where is Sandcastle? -->
<property name="sandcastle.dir" value="${environment::get-folder-path('ProgramFiles')}\Sandcastle" overwrite="false" />
<!-- Where is HTML Help 1.0? -->
<property name="htmlhelp1x.dir" value="${environment::get-folder-path('ProgramFiles')}\HTML Help Workshop" overwrite="false" />
</target>
</project>