forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNHibernateSolution.build
517 lines (454 loc) · 21.4 KB
/
NHibernateSolution.build
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<?xml version="1.0" ?>
<project
name="NHibernateSolution"
default="build"
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"
>
<!--
if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed
then change this to true. It generates a nice looking html report for the test files
-->
<property name="nunit2report.installed" value="false" />
<!--
if Visual Studio Help Integration Kit has been installed
then change this to true or include -D:vshik.installed=true in the command line.
It generates Visual Studio.NET 2003 documentation.
-->
<property name="vshik.installed" value="false" overwrite="false" />
<!--
Cenqua provided a license of Clover.NET for the NHibernate project to use.
-->
<property name="clover.enabled" value="false" />
<property name="clover.src" value="src\CloverSrc" />
<property name="clover.db" value="${clover.src}\clover.cdb" />
<property name="clover.home" value="C:/Program Files/Cenqua/Clover.NET for Visual Studio" />
<property name="clover.assembly" value="CloverNAnt-0.85.dll" />
<!--
Use this to determine if the key file NHibernate.key should be used to
sign the Assemblies. This defaults to false since users doing their own
build have _no_ copy of the private key. If they do their own private
builds then they should make their own key
-->
<property name="sign" value="false" />
<!--
These are used to set the correct Attributes in AssemblyInfo.cs.
-->
<property name="project.name" value="nhibernate" />
<property name="project.version.major" value="0" />
<property name="project.version.minor" value="8" />
<property name="project.version.build" value="2" />
<property name="project.version.revision" value="0" />
<property name="project.version" value="${project.version.major}.${project.version.minor}.${project.version.build}.${project.version.revision}" />
<!-- default configuration -->
<property name="project.config" value="debug" />
<!-- debug|release -->
<property name="build.defines" value="" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- properties used to connect to database for testing -->
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<property name="nhibernate.connection.connection_string" value="Server=localhost;initial catalog=nhibernate;Integrated Security=SSPI" />
<!-- named project configurations -->
<target name="debug" description="Perform a 'debug' build">
<property name="project.config" value="debug" />
<property name="build.debug" value="true" />
<property name="build.name" value="${project.name}-${project.version}-${project.config}" />
<property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}" />
</target>
<target name="release" description="Perform a 'release' build">
<property name="project.config" value="release" />
<property name="build.debug" value="false" />
<property name="build.name" value="${project.name}-${project.version}" />
<property name="build.dir" value="${nant.project.basedir}/build/${project.name}-${project.version}" />
</target>
<target name="init" description="Initializes build properties">
<call target="${project.config}" />
<call target="set-runtime-configuration" />
</target>
<target name="clean" depends="init" description="Deletes current build">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="clean-bin" depends="init" description="Deletes the current bin folder">
<delete dir="${build.dir}/bin" failonerror="false" />
</target>
<target name="cleanall" description="Deletes every build configuration">
<echo message="Deleting all builds from all configurations" />
<delete dir="build" failonerror="false" />
</target>
<target
name="build-external"
depends="init"
description="Builds code that NHibernate depends on but is not a core peice of NHibernate. The built dll/exes will be distributed in the lib folder so there should be no need for a user to build it."
>
<nant target="build" buildfile="src/HashCodeProvider/HashCodeProvider.build" />
<!-- the Iesi.Collections.build takes care of determining if this is a clover build or not -->
<nant target="coverage-report" buildfile="src/Iesi.Collections/Iesi.Collections.build" />
</target>
<target name="build-with-clover" depends="init" description="Builds current config with Clover coverage">
<!--
mark this as being a clover enabled build and then just let the normal build
process take place
-->
<property name="clover.enabled" value="true" />
</target>
<target name="build-without-clover" depends="init" description="Ensures the build is done without Clover coverage">
<!--
This does not really need to be called unless the clover.enabled property has been explicitly
set to true by some other means since clover.enabled defaults to false. It is my intention
to first do a clover build to get the coverage then to do a non-clover build to get the
clover-free dlls.
-->
<property name="clover.enabled" value="false" />
</target>
<target name="build" depends="init" description="Builds current configuration">
<echo message="Current Directory is ${nant.project.basedir}" />
<echo message="Build Directory is ${build.dir}" />
<!-- prepare build directory -->
<mkdir dir="${build.dir}/bin" />
<copy file="lgpl.txt" tofile="${build.dir}/bin/NHibernate.license.txt" />
<!-- copy framework-nuetral libraries -->
<copy todir="${build.dir}/bin">
<fileset basedir="lib">
<include name="HashCodeProvider.*" />
</fileset>
</copy>
<!-- copy framework-specific libraries -->
<copy todir="${build.dir}/bin">
<fileset basedir="${lib.dir}">
<!--
Excludes the Iesi.Collections Assembly because it is built during the build
of NHibernate. It is in the lib folder for vs.net convenience. However, we
do want to copy the license file.
-->
<exclude name="Iesi.Collections.dll" />
<exclude name="Iesi.Collections.xml" />
<include name="Iesi.Collections.license.txt" />
<include name="Castle.DynamicProxy.*" />
<include name="log4net.*" />
<include name="nunit.framework.*" />
</fileset>
</copy>
<nant target="build" buildfile="src/Iesi.Collections/Iesi.Collections.build" />
<nant target="build" buildfile="src/Iesi.Collections.Test/Iesi.Collections.Test.build" />
<nant target="build" buildfile="src/NHibernate/NHibernate.build" />
<nant target="build" buildfile="src/NHibernate.DomainModel/NHibernate.DomainModel.build" />
<nant target="build" buildfile="src/NHibernate.Test/NHibernate.Test.build" />
<nant target="build" buildfile="src/NHibernate.Examples/NHibernate.Examples.build" />
</target>
<target name="test" depends="build" description="Runs the tests contained in NHibernate.Test" >
<!-- make sure the config file is NOT readonly -->
<attrib file="${build.dir}/bin/NHibernate.Test.dll.config" readonly="false" />
<!--
Tell nhibernate how to connect to the test database.
-->
<xmlpoke
file="${build.dir}/bin/NHibernate.Test.dll.config"
xpath="/configuration/nhibernate/add[@key='hibernate.dialect']/@value"
value="${nhibernate.dialect}"
/>
<xmlpoke
file="${build.dir}/bin/NHibernate.Test.dll.config"
xpath="/configuration/nhibernate/add[@key='hibernate.connection.driver_class']/@value"
value="${nhibernate.connection.driver_class}"
/>
<xmlpoke
file="${build.dir}/bin/NHibernate.Test.dll.config"
xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value"
value="${nhibernate.connection.connection_string}"
/>
<nant target="test" buildfile="src/NHibernate.Test/NHibernate.Test.build" />
<nant target="test" buildfile="src/Iesi.Collections.Test/Iesi.Collections.Test.build" />
<!--
Remove the connnection string information that was just entered...
-->
<xmlpoke
file="${build.dir}/bin/NHibernate.Test.dll.config"
xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value"
value="conn string here"
/>
<if test="${nunit2report.installed}">
<mkdir dir="${build.dir}/testresults" />
<nunit2report out="${build.dir}/testresults/index.html" format="Frames" todir="${build.dir}/testresults">
<fileset>
<include name="${build.dir}\bin\*results.xml" />
</fileset>
</nunit2report>
</if>
<!-- if this was a clover enabled build then generate the clover reports for it -->
<call target="coverage-report" if="${clover.enabled}" />
<!--
Clean up all of the non-essential assemblies and files that get put in the
bin folder to run the test fixtures and that are generated during the running
of the test fixtures.
-->
<delete>
<fileset basedir="${build.dir}/bin">>
<!-- Any hbm.xml and cfg.xml files in the bin are for testing purposes -->
<include name="*.hbm.xml" />
<include name="*.cfg.xml" />
<!-- The MyTest Assembly was used in the AssemblyOrderer fixtures -->
<include name="MyTest*.dll" />
<include name="MyTest*.pdb" />
<!-- Go ahead and delete the log file that contains all the sql output-->
<include name="log.txt" />
<!--
Remove test related assemblies and files so the bin directory is
clean and ready for the downloader to use.
-->
<include name="Iesi.Collections.Test.*" />
<include name="NHibernate.DomainModel.*" />
<include name="NHibernate.Examples.*" />
<include name="NHibernate.Test.*" />
<include name="nunit.framework.*" />
</fileset>
</delete>
</target>
<target name="coverage-report" description="Builds the Test Coverage reports">
<mkdir dir="${build.dir}/clover" />
<clover-setup
initstring="${clover.db}"
flushinterval="1000"
/>
<clover-report>
<current title="NHibernate Clover Report" output="${build.dir}/clover" >
<format type="html" orderby="Alpha" />
</current>
</clover-report>
</target>
<target name="doc" depends="init" description="Builds the API documentation and the Help Documentation" >
<call target="sdkdoc" />
<property name="lang" value="en" />
<nant target="clean build" buildfile="doc/reference/doc.build">
<properties>
<property name="lang" value="${lang}" />
</properties>
</nant>
<if test="${vshik.installed}">
<!--
move the generated Help2 (HxS) files from the sdk that
were built by ndoc into the help2 folder for this build.
-->
<move flatten="true" todir="${build.dir}/doc/${lang}/help2/Titles">
<fileset basedir="${build.dir}/doc/sdk">
<include name="**/*.HxS" />
</fileset>
</move>
</if>
</target>
<target name="sdkdoc" depends="init" description="Generates MSDN sytle documentation">
<ndoc>
<assemblies basedir="${build.dir}/bin">
<include name="NHibernate.dll" />
<include name="Iesi.Collections.dll" />
</assemblies>
<summaries>
<include name="src/NHibernate/NamespaceSummary.xml" />
<include name="src/Iesi.Collections/NamespaceSummary.xml" />
</summaries>
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="${build.dir}/doc/sdk" />
<property name="HtmlHelpName" value="NHibernate-SDK" />
<property name="IncludeFavorites" value="False" />
<property name="Title" value="NHibernate Class Library - v.${project.version}" />
<property name="SplitTOCs" value="False" />
<property name="DefaulTOC" value="" />
<property name="IncludeHierarchy" value="False" />
<property name="ShowVisualBasic" value="False" />
<property name="RootPageContainsNamespaces" value="False" />
<property name="SortTOCByNamespace" value="True" />
<property name="OutputTarget" value="HtmlHelp" />
<property name="HeaderHtml" value="" />
<property name="FooterHtml" value="" />
<property name="FilesToInclude" value="" />
<property name="LinkToSdkDocVersion" value="SDK_v1_1" />
<property name="ShowMissingSummaries" value="${build.debug}" />
<property name="ShowMissingRemarks" value="${build.debug}" />
<property name="ShowMissingParams" value="${build.debug}" />
<property name="ShowMissingReturns" value="${build.debug}" />
<property name="ShowMissingValues" value="${build.debug}" />
<property name="DocumentInternals" value="False" />
<property name="DocumentProtected" value="True" />
<property name="DocumentPrivates" value="False" />
<property name="DocumentProtectedInternalAsProtected" value="False" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="IncludeAssemblyVersion" value="False" />
<property name="CopyrightText" value="" />
<property name="CopyrightHref" value="" />
<property name="ReferencesPath" value="" />
<property name="SkipNamespacesWithoutSummaries" value="False" />
<property name="UseNamespaceDocSummaries" value="False" />
<property name="AutoPropertyBackerSummaries" value="False" />
<property name="AutoDocumentConstructors" value="True" />
<property name="DocumentAttributes" value="True" />
<property name="ShowTypeIdInAttributes" value="False" />
<property name="DocumentedAttributes" value="True" />
<property name="GetExternalSummaries" value="True" />
<property name="EditorBrowsableFilter" value="Off" />
<property name="UseNDocXmlFile" value="" />
</documenter>
</documenters>
</ndoc>
<if test="${vshik.installed}">
<ndoc>
<assemblies basedir="${build.dir}/bin">
<include name="NHibernate.dll" />
<include name="Iesi.Collections.dll" />
</assemblies>
<summaries>
<include name="src/NHibernate/NamespaceSummary.xml" />
<include name="src/Iesi.Collections/NamespaceSummary.xml" />
</summaries>
<documenters>
<documenter name="VS.NET 2003">
<property name="OutputDirectory" value="${build.dir}/doc/sdk" />
<property name="HtmlHelpName" value="NHibernate-SDK" />
<property name="Title" value="NHibernate Class Library - v.${project.version}" />
<property name="HeaderHtml" value="" />
<property name="FooterHtml" value="" />
<property name="LinkToSdkDocVersion" value="SDK_v1_1" />
<property name="ShowMissingSummaries" value="${build.debug}" />
<property name="ShowMissingRemarks" value="${build.debug}" />
<property name="ShowMissingParams" value="${build.debug}" />
<property name="ShowMissingReturns" value="${build.debug}" />
<property name="ShowMissingValues" value="${build.debug}" />
<property name="DocumentInternals" value="False" />
<property name="DocumentProtected" value="True" />
<property name="DocumentPrivates" value="False" />
<property name="DocumentProtectedInternalAsProtected" value="False" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="CopyrightText" value="" />
<property name="CopyrightHref" value="" />
<property name="ReferencesPath" value="" />
<property name="SkipNamespacesWithoutSummaries" value="False" />
<property name="UseNamespaceDocSummaries" value="False" />
<property name="AutoPropertyBackerSummaries" value="False" />
<property name="AutoDocumentConstructors" value="True" />
<property name="DocumentAttributes" value="True" />
<property name="ShowTypeIdInAttributes" value="False" />
<property name="DocumentedAttributes" value="True" />
<property name="EditorBrowsableFilter" value="Off" />
<property name="UseNDocXmlFile" value="" />
</documenter>
</documenters>
</ndoc>
</if>
<delete>
<!-- remove all of the html, gif, etc... files and leave only the chm and HxS -->
<fileset basedir="${build.dir}/doc/sdk">
<include name="**" />
<exclude name="*SDK.chm" />
<exclude name="*SDK.HxS" />
</fileset>
</delete>
</target>
<target name="package" depends="test doc" description="Creates Zip files for the File Release System on SourceForge">
<copy todir="${build.dir}">
<fileset>
<!-- copy framework nuetral dlls -->
<include name="lib/*" />
<include name="${lib.dir}/**" />
<!--
exclude the UnitTesting project that is no longer used and the
Clover modified source files.
-->
<exclude name="src/UnitTesting/**" />
<exclude name="${clover.src}/**" />
<!-- exclude ReSharper stuff -->
<exclude name="**/_ReSharper*/**" />
<exclude name="**/*.resharperoptions" />
<include name="src/**" />
<include name="NHibernateSolution.build" />
<include name="lgpl.txt" />
<include name="releasenotes.txt" />
<include name="readme.html" />
<!-- exclude VS.NET stuff -->
<exclude name="**/*.suo" />
<exclude name="**/*j.user" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
<!-- exclude any keys that exist on the build machine -->
<exclude name="**/*.snk" />
</fileset>
</copy>
<property name="project.zip-path" value="${nant.project.basedir}/build/${build.name}.zip" />
<zip zipfile="${project.zip-path}">
<fileset basedir="${build.dir}">
<include name="**/*" />
<exclude name="bin/log.txt" />
</fileset>
</zip>
<!-- delete the directory that was used to create the zip -->
<!--<delete dir="${build.dir}" />-->
<echo message="Create a '${project.config}' package as file://${project.zip-path}" />
</target>
<!-- Framework specific configuration -->
<target name="set-runtime-configuration">
<!--
We are not building for anything but the .net 1.1 framework right now
I've been goofing around with mono but am having problems with nant 0.85
and nunit-2.2 related tasks. Probably something simple, but I think I've
followed all the instructions to get that working...
-->
<call target="set-net-1.1-runtime-configuration" />
<!--
<ifnot propertyexists="current.runtime.config">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NAnt." />
</ifnot>
<call target="set-${nant.settings.currentframework}-runtime-configuration"/>
</ifnot>
<ifnot propertyexists="current.runtime.version">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NDoc." />
</ifnot>
<call target="set-${nant.settings.currentframework}-runtime-configuration" />
</ifnot>
<ifnot targetexists="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration">
<fail message="The ${current.runtime.config}-${current.runtime.version} runtime is not supported by NDoc." />
</ifnot>
<call target="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration"/>
-->
</target>
<target name="set-runtime-configuration-flags">
<property name="current.runtime.config.net" value="false" />
<property name="current.runtime.config.netcf" value="false" />
<property name="current.runtime.config.mono" value="false" />
<property name="current.runtime.config.sscli" value="false" />
<property name="current.runtime.config.${current.runtime.config}" value="true" />
<property name="current.runtime.net-1.0" value="false" />
<property name="current.runtime.net-1.1" value="false" />
<property name="current.runtime.net-1.2" value="false" />
<property name="current.runtime.netcf-1.0" value="false" />
<property name="current.runtime.mono-1.0" value="false" />
<property name="current.runtime.sscli-1.0" value="false" />
<property name="current.runtime.${current.runtime.config}-${current.runtime.version}" value="true" />
</target>
<target name="set-net-1.1-runtime-configuration">
<property name="current.runtime.config" value="net" />
<property name="current.runtime.version" value="1.1" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.1" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_1" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
<target name="set-mono-1.0-runtime-configuration">
<property name="current.runtime.config" value="mono" />
<property name="current.runtime.version" value="1.0" />
<property name="current.runtime.description" value="Mono 1.0" />
<property name="current.build.defines" value="${build.defines}MONO,MONO_1_0" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
</project>