-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcommon.xml
More file actions
281 lines (238 loc) · 14.2 KB
/
common.xml
File metadata and controls
281 lines (238 loc) · 14.2 KB
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
<?xml version="1.0"?>
<project name="rhino.tools" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="test.db"
value="Data Source=localhost;Initial Catalog=Test;Integrated Security=True"/>
<property name="test.db.xpath"
value="/configuration/connectionStrings/add[@name='test']/@connectionString"/>
<!--
Use this to determine if the key file ayende-open-source.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" />
<property name="key.file" value="${path::get-full-path(root.dir)}/ayende-open-source.snk" />
<!-- 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 -->
<!-- Check which nant version we're using - fail if it's not the minium -->
<property name="current.nant-version" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />
<property name="required.nant-version" value="0.85.2478.0" /> <!-- Nant 0.85 release version -->
<property name="clr.dir" value="${framework::get-assembly-directory( framework::get-runtime-framework () )}"/>
<!--
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="${path::get-full-path(root.dir)}/SharedLibs" dynamic="true" />
<property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" />
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />
<!--
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="Rhino Tools 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.debug" value="Enable" overwrite="false" />
<property name="build.optimize" value="false" overwrite="false" />
</target>
<target name="set-release-project-configuration" description="Perform a 'release' build">
<property name="build.debug" value="None" overwrite="false" />
<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="prop.dir" value="${src.dir}/Properties" />
<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="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 Rhino Tools." />
</if>
<property name="csc.keyfile" value="" />
<property name="csc.args" value="" />
<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="link.sdkdoc.version" value="SDK_v2_0" />
<property name="merge.targetplatform" value="v2" />
<property name="csc.keyfile" value='/keyfile:"${key.file}"' />
<!-- 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" />
<property name="csc.keyfile" value='/keyfile:"${key.file}"' />
<!-- 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()}-vs2008.csproj" />
</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="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="" />
</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" />
<exclude name="${src.dir}/obj/**/*.cs" />
<exclude name="${src.dir}/bin/**/*.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"/>
<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')}">
<exec
program="${mbunit-console}"
resultproperty="mbunit.found"
failonerror="false" />
<property name="mbunit.found" value="${mbunit.found == '0' and string::to-lower(testrunner)=='mbunit'}" readonly="true" />
<property name="nunit.found" value="-1" />
<exec
unless="${mbunit.found}"
program="${nunit-console2}"
resultproperty="nunit.found"
failonerror="false" />
<property name="nunit-console" value="${nunit-console2}" if="${nunit.found == '0'}" />
<exec unless="${mbunit.found or 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 or MBUnit not found, cannot continue." unless="${nunit.found or mbunit.found}"/>
<echo message="INFO: Using MBUnit for running unit tests" if="${mbunit.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}</echo>
</if>
</if>
</target>
<target name="common.check-nant-version">
<fail if="${current.nant-version<required.nant-version}" message="Not using minimum required Nant version: ${required.nant-version} (current version: ${current.nant-version}). Please upgrade your copy of nant." />
</target>
<target name="common.find-tools">
<!-- Where is MbUnit.Cons.exe ? -->
<property name="mbunit-console" value="${lib.dir}\Tools\MbUnit\MbUnit.Cons.exe" overwrite="false" />
<!-- Where is nunit-console executable(win/mono) ? -->
<property name="nunit-console2" value="nunit-console2" overwrite="false" />
<property name="nunit-console" value="nunit-console" overwrite="false" />
<property name="testrunner" value="mbunit" />
<!-- 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>