forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.build
372 lines (309 loc) · 13 KB
/
default.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
<?xml version="1.0" ?>
<project
name="NHibernate"
default="build"
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"
>
<property name="root.dir" value="." />
<include buildfile="${root.dir}/build-common/common.xml" />
<!-- Pass -D:skip.tests=true to NAnt to skip running tests when building -->
<property name="skip.tests" value="false" overwrite="false" />
<property name="skip.manual" value="false" overwrite="false" />
<!--
Supported versions of .NET Framework, separated by spaces.
Used by *-all-frameworks targets.
-->
<property name="supported.frameworks" value="net-4.0" />
<fileset id="buildfiles.all" basedir="src">
<!-- Files have to be in dependency order -->
<include name="NHibernate/NHibernate.build" />
<include name="NHibernate.DomainModel/NHibernate.DomainModel.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
<include name="NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.build" />
<include name="NHibernate.TestDatabaseSetup/TestDatabaseSetup.build" />
<include name="NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.build" />
</fileset>
<fileset id="buildfiles.tests" basedir="src">
<include name="NHibernate.TestDatabaseSetup/TestDatabaseSetup.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
<include name="NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.build" />
</fileset>
<target name="init" depends="common.init" description="Initializes build properties" />
<target name="prepare-build-directory" depends="init">
<mkdir dir="${bin.dir}" />
<mkdir dir="${testresults.dir}" />
<call target="copy-referenced-assemblies" />
</target>
<target name="copy-referenced-assemblies">
<!-- Copy framework-neutral libraries -->
<copy todir="${bin.dir}" >
<fileset basedir="${lib.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
<include name="nant/*.*" />
</fileset>
</copy>
<!-- Copy family-specific libraries -->
<!--
The builds of log4net and nunit work just fine for all versions of .NET.
When they do get framework specific extensions then we
can just move them to the framework specific section
-->
<copy todir="${bin.dir}">
<fileset basedir="${lib.family.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
</fileset>
</copy>
<!-- Copy framework-specific libraries -->
<copy todir="${bin.dir}">
<fileset basedir="${lib.framework.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
</fileset>
</copy>
</target>
<target name="build"
depends="check-framework-version init prepare-build-directory"
description="Builds NHibernate in the current configuration">
<nant target="build">
<buildfiles refid="buildfiles.all" />
</nant>
</target>
<target name="check-framework-version">
<echo>Running with ${framework::get-target-framework()}</echo>
<fail message="ERROR: NHibernate requires .Net 4.0." if="${framework::get-target-framework()!='net-4.0'}"/>
</target>
<target name="test-report" if="${nunit2report.installed}">
<mkdir dir="${build.dir}/testresults" />
<nunit2report out="${build.dir}/testresults/index.html" format="Frames" todir="${build.dir}/testresults">
<fileset>
<include name="${bin.dir}/*results.xml" />
</fileset>
</nunit2report>
</target>
<target name="test" depends="init build" description="Runs all NHibernate tests for the current framework" unless="${skip.tests}">
<nant target="test">
<buildfiles refid="buildfiles.tests" />
</nant>
</target>
<target name="doc" depends="init binaries"
description="Builds the Help Documentation and the API documentation">
<nant buildfile="doc/documentation.build" target="api manual" />
</target>
<target name="reference" depends="init binaries" unless="${skip.manual}"
description="Builds Reference Manual">
<nant buildfile="doc/documentation.build" target="manual" />
</target>
<target name="reference-zip" depends="init binaries" unless="${skip.manual}"
description="Builds Reference Manual zip">
<nant buildfile="doc/documentation.build" target="manual-zip"/>
</target>
<target name="api" depends="init binaries"
description="Builds the API Documentation">
<nant buildfile="doc/documentation.build" target="api" />
</target>
<target name="build-all-frameworks" depends="init">
<!-- Save the current framework -->
<property name="current.framework.saved" value="${nant.settings.currentframework}" />
<!-- Execute build for each framework -->
<foreach item="String" delim=" " property="framework" in="${supported.frameworks}">
<call target="set-${framework}-framework-configuration" />
<call target="build" />
<!-- Copy and rename the license -->
<copy file="lgpl.txt" tofile="${bin.dir}/NHibernate.license.txt" />
</foreach>
<!-- Reset the current framework to the saved value -->
<call target="set-${current.framework.saved}-framework-configuration" />
</target>
<target name="binaries" depends="init">
<call target="build" />
</target>
<target name="test-all-frameworks" depends="init">
<!-- Save the current framework -->
<property name="current.framework.saved" value="${nant.settings.currentframework}" />
<!-- Execute build for each framework -->
<foreach item="String" delim=" " property="framework" in="${supported.frameworks}">
<call target="set-${framework}-framework-configuration" />
<call target="test" />
</foreach>
<!-- Reset the current framework to the saved value -->
<call target="set-${current.framework.saved}-framework-configuration" />
</target>
<target name="reports" depends="init">
<call target="test-all-frameworks" />
<call target="test-report" />
<call target="coverage-report" />
</target>
<target name="sources">
<property name="source.tmpdir" value="${build.dir}/tmp-src" />
<copy todir="${source.tmpdir}">
<fileset>
<!-- copy dlls used by this build -->
<include name="${lib.dir}/**" />
<!-- copy all of the NHibernate source -->
<include name="src/NHibernate*/**" />
<include name="src/*.*" />
<include name="build-common/**" />
<include name="*.build" />
<include name="gfdl.txt" />
<include name="lgpl.txt" />
<include name="releasenotes.txt" />
<include name="readme.html" />
<!-- exclude ReSharper stuff -->
<exclude name="**/_ReSharper*/**" />
<exclude name="**/*.resharperoptions" />
<exclude name="**/*resharper*" />
<!-- exclude VS.NET stuff -->
<exclude name="**/*.suo" />
<exclude name="**/*.user" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
</fileset>
</copy>
<!-- Generate AssemblyInfo.cs files for Visual Studio -->
<nant buildfile="${source.tmpdir}/default.build" target="visual-studio" />
</target>
<target name="sources-zip" depends="init sources">
<zip zipfile="${build.dir}/NHibernate-${project.version}-src.zip">
<fileset basedir="${source.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="binaries-zip" depends="init bin-pack">
<zip zipfile="${build.dir}/NHibernate-${project.version}-bin.zip">
<fileset basedir="${bin-pack.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="bin-pack" depends="init binaries">
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
<property name="bin-pack.conf-template" value="${bin-pack.tmpdir}/Configuration_Templates" />
<property name="bin-pack.required" value="${bin-pack.tmpdir}/Required_Bins" />
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
<copy file="releasenotes.txt" todir="${bin-pack.tmpdir}"/>
<copy file="lgpl.txt" todir="${bin-pack.tmpdir}/NHibernate.license.txt"/>
<copy file="gfdl.txt" todir="${bin-pack.tmpdir}"/>
<copy file="HowInstall.txt" todir="${bin-pack.tmpdir}"/>
<exec program="CScript.exe"
commandline="Tools\showdown\showdown.wsf README.md ${bin-pack.tmpdir}/readme.html"/>
<!--Configuration templates-->
<copy todir="${bin-pack.conf-template}">
<fileset basedir="src/NHibernate.Config.Templates">
<include name="*"/>
</fileset>
</copy>
<!--Minimal Required Bins-->
<copy todir="${bin-pack.required}">
<fileset basedir="src/NHibernate">
<include name="*.xsd" />
</fileset>
</copy>
<copy todir="${bin-pack.required}">
<fileset basedir="${bin.dir}">
<include name="Iesi.Collections.???" />
<include name="NHibernate.???" />
</fileset>
</copy>
<!--Required Bins for lazy loading NHibernate.ByteCode.Castle.dll-->
<!-- Tests -->
<copy file="${bin.dir}/TestEnbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
<copy file="${bin.dir}/ABC.hbm.xml" todir="${bin-pack.tests}"/>
<copy todir="${bin-pack.tests}/DbScripts">
<fileset basedir="${root.dir}/src/NHibernate.Test/DbScripts">
<include name="*.sql" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${bin.dir}">
<include name="nunit*" />
<include name="SharpTestsEx*" />
<include name="NHibernate.Domain*" />
<include name="NHibernate.Test*" />
<include name="log4net*" />
</fileset>
</copy>
</target>
<target name="package" depends="init binaries test reference-zip sources-zip binaries-zip"
description="Creates files for the General Available Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="release" depends="init binaries binaries-zip sources-zip"
description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="visual-studio" depends="init" description="Modifies AssemblyInfo.cs files to work with Visual Studio">
<property name="visual-studio" value="true" />
<nant target="generate-assemblyinfo">
<buildfiles refid="buildfiles.all" />
</nant>
</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="clean" depends="init" description="Deletes current build">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="gen-schema-classes" descripton="Generates schema classes from nhibernate-mapping.xsd">
<exec program="xsd.exe"
commandline="src\NHibernate\nhibernate-mapping.xsd /classes /fields /order /namespace:NHibernate.Cfg.MappingSchema /out:src\NHibernate\Cfg\MappingSchema\"/>
</target>
<fileset id="nugetfiles.all" basedir="src">
<include name="NHibernate/NHibernate.build" />
</fileset>
<target name="nuspec" depends="init nuget.set-properties" description="Create nuspec files">
<nant target="nuspec">
<buildfiles refid="nugetfiles.all" />
</nant>
</target>
<target name="nuget" depends="init binaries nuget.set-properties nuspec"
description="Creates files for the release on nuget gallery.">
<nant target="nuget">
<buildfiles refid="nugetfiles.all" />
</nant>
<mkdir dir="${nuget.nupackages.dir}" />
<move todir="${nuget.nupackages.dir}">
<fileset basedir="${nuget.workingdir}">
<include name="*.nupkg" />
</fileset>
</move>
</target>
<target name="nugetpushbat" depends="init binaries nuget.set-properties nuspec nuget"
description="Creates files for the release on nuget gallery.">
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
<foreach item="File" property="filename">
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<echo message="nuget push ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
</do>
</foreach>
</target>
<target name="nugetpush" depends="init binaries nuget.set-properties nuspec nuget"
description="Push packages on nuget gallery.">
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
<foreach item="File" property="filename">
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe">
<arg value="push" />
<arg value="${filename}" />
</exec>
</do>
</foreach>
</target>
</project>