forked from darioquintana/NHibernate-Validator
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdefault.build
258 lines (220 loc) · 8.89 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
<?xml version="1.0" ?>
<project
name="NHibernate Validator"
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" />
<property name="lib.dir" value="${root.dir}/lib" />
<property name="doc.dir" value="${root.dir}/doc" />
<property name="example.dir" value="${root.dir}/examples" />
<property name="net.target-fx" value="net461" />
<property name="net.core-fx" value="netcoreapp2.0" />
<property name="net.standard" value="netstandard2.0" />
<!-- Pass -D:skip.tests=true to NAnt to skip running tests when building -->
<property name="skip.tests" value="false" overwrite="false" />
<!-- Disable performance tests by default. They take too much time. -->
<property name="run.performance.tests" value="false" overwrite="false" />
<!--
Supported versions of .NET Framework, separated by spaces.
Used by *-all-frameworks targets.
-->
<property name="supported.frameworks" value="net-4.5" />
<fileset id="buildfiles.all" basedir="src">
<include name="NHibernate.Validator/default.build" />
<include name="NHibernate.Validator.Specific/default.build" />
</fileset>
<fileset id="buildfiles.tests" basedir="src">
<include name="NHibernate.Validator.Tests/default.build" />
<include name="NHibernate.Validator.Specific.Tests/default.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-files" />
</target>
<target name="copy-referenced-files">
<copy file="src/NHibernate.Validator/Cfg/nhv-mapping.xsd" tofile="${build.dir}/schema/nhv-mapping.xsd"/>
<copy file="src/NHibernate.Validator/Cfg/nhv-configuration.xsd" tofile="${build.dir}/schema/nhv-configuration.xsd"/>
</target>
<target name="build"
depends="init clean prepare-build-directory common.nuget-restore common.solution-restore"
description="Builds NHibernate in the current configuration">
<nant target="build">
<buildfiles refid="buildfiles.all" />
</nant>
<exec program="${path::combine(tools.dir, 'dotnet.cmd')}" verbose="true">
<arg value="${root.dir}/src/NHibernate.Validator.sln" />
<arg value="/p:Platform="Any CPU"" />
<arg value="/p:Configuration="${build.config}"" />
<!-- 6.0 TODO: pack projects separately
<arg value="/p:GeneratePackageOnBuild="True"" if="${build.release == 'true'}" />
<arg value="/p:IncludeSymbols="True"" />
<arg value="/p:IncludeSource="True"" />
<arg value="/p:PackageOutputPath="${path::get-full-path(path::combine(root.dir, 'build'))}"" /> -->
<arg value="/t:Restore" />
<arg value="/t:Rebuild" />
<arg value="/v:q" />
<arg value="/m" />
</exec>
</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.Validator 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="sources" depends="binaries">
<property name="source.tmpdir" value="${build.dir}/tmp-src" />
<copy todir="${source.tmpdir}">
<fileset>
<!-- copy dlls used by this build -->
<include name="${lib.dir}/**" />
<include name="${example.dir}/**" />
<!-- copy all of the NHibernate source -->
<include name="src/NHibernate*/**" />
<include name="src/*.*" />
<include name="build-common/**" />
<include name="*.build" />
<include name="*.bat" />
<include name="License.txt" />
<include name="releasenotes.txt" />
<include name="readme.md" />
<!-- 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>
</target>
<target name="sources-zip" depends="sources">
<mkdir dir="${build.dir}/src" />
<zip zipfile="${build.dir}/src/NHibernate.Validator-${project.version}-src-and-examples.zip">
<fileset basedir="${source.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="copy-release-notes" depends="init">
<copy file="releasenotes.txt" todir="${build.dir}" />
<copy file="LICENSE.txt" todir="${build.dir}" />
<copy file="readme.md" todir="${build.dir}" />
</target>
<target name="binaries" depends="init build">
<copy todir="${bin.dir}../../../testsbins">
<fileset basedir="src/NHibernate.Validator.Specific.Tests/bin/${build.config}/${net.target-fx}">
<include name="*Test*dll" />
<include name="nunit.*.dll" />
<include name="SharpTestsEx*.dll" />
<include name="nhvalidator.cfg.xml"/>
<include name="*.config"/>
<include name="NHibernate.Envers.*" />
</fileset>
</copy>
<copy todir="${bin.dir}">
<fileset basedir="src/NHibernate.Validator.Specific/bin/${build.config}/${net.target-fx}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="nugetdeploy" depends="init build">
<copy todir="${build.nuget.dir}/bin/${net.target-fx}">
<fileset basedir="${bin.dir}">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${build.nuget.dir}/bin/${net.standard}">
<fileset basedir="src/NHibernate.Validator.Specific/bin/${build.config}/${net.standard}">
<include name="**/*" />
<exclude name="**/*.deps.json" />
</fileset>
</copy>
<copy todir="${build.nuget.dir}">
<fileset basedir="${build.dir}/schema">
<include name="*" />
</fileset>
</copy>
<copy file="LICENSE.txt" todir="${build.nuget.dir}" />
<copy file="releasenotes.txt" todir="${build.nuget.dir}" />
<copy file="readme.md" todir="${build.nuget.dir}" />
<delete>
<fileset basedir="${build.nuget.dir}/bin/${net.target-fx}">
<include name="test-results/**/*.*" />
<include name="NHibernate.dll" />
<include name="NHibernate.xml" />
<include name="nunit*" />
<include name="SharpTestsEx*" />
<include name="log4net*" />
<include name="*test*" />
<include name="Castle.Core*" />
<include name="Antlr3.Runtime*" />
<include name="Iesi*" />
<include name="LinFu.DynamicProxy*" />
<include name="NHibernate.ByteCode*" />
<include name="Remotion*" />
</fileset>
</delete>
<exec basedir="${tools.dir}" workingdir="${root.dir}/build" program="NuGet.exe">
<arg value="pack" />
<arg value="../NHibernate.Validator.nuspec" />
</exec>
</target>
<target name="binaries-zip" depends="init binaries copy-release-notes">
<zip zipfile="${build.dir}/bin/NHibernate.Validator-${project.version}-bin.zip">
<fileset basedir="${build.dir}">
<include name="releasenotes.txt" />
<include name="LICENSE.txt" />
<include name="readme.md" />
<include name="*.xsd" />
<include name="bin/**" />
<include name="schema/**" />
<include name="testsbins/**" />
<exclude name="**/*.hbm.xml" />
<exclude name="**/*.commandlog" />
<exclude name="**/MyTest*" />
</fileset>
</zip>
</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="package" depends="init test binaries doc sources-zip binaries-zip "
description="Creates files for the File Release System on SourceForge">
<property name="dist.output.dir" value="${project::get-base-directory()}/build/" />
<move todir="${dist.output.dir}" flatten="true" overwrite="true">
<fileset basedir="${build.dir}">
<include name="*.msi" />
<include name="src/NHibernate.Validator-${project.version}-src-and-examples.zip" />
<include name="bin/NHibernate.Validator-${project.version}-bin.zip" />
</fileset>
</move>
<echo message="Created a '${project.config}' package in ${dist.output.dir}" />
</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>
</project>