forked from mvccontrib/MvcContrib-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nant.build
309 lines (291 loc) · 12.5 KB
/
nant.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
<?xml version="1.0" encoding="utf-8"?>
<project name="MVCContrib" default="build" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="solution.dir" value="src"/>
<property name="solution.file" value="${solution.dir}/MVCContrib.sln"/>
<property name="trunk.dir" value="."/>
<property name="company.name" value="MVC Contrib"/>
<property name="bin.dir" value="bin" />
<property name="build.base" value="build"/>
<property name="results.dir" value="${build.base}\results" />
<property name="samples.dir" value="src\samples"/>
<property name="project.fullversion" value="1.0.0.99" />
<property name="project.fullversion" value="${build.number}" if="${property::exists('build.number')}"/>
<!--
<property name="revisionnumber" value="0" dynamic="true"/>
<property name="project.fullversion" value="1.0.${revisionnumber}.0" dynamic="true"/>
<property name="version.major" value="1"/>
<property name="version.minor" value="0"/>
<property name="version.build" value="0"/>
<property name="version.revision" value="0"/>
<property name="project.fullversion" value="${version.major}.${version.minor}.${version.build}.${version.revision}" dynamic="true" />
-->
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="msbuild.path" value="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe" />
<property name="nunit.path" value="bin\nunit\nunit-console-x86.exe" />
<property name="runtests" value="true" unless="${property::exists('runtests')}" />
<!-- default configuration -->
<property name="project.config" value="release" />
<!-- debug|release -->
<property name="build.dir" value="${build.base}/${nant.settings.currentframework}.${platform::get-name()}-${project::get-name()}-${project.config}/"/>
<target name="build" depends="clean, version, init, commonassemblyinfo, compile, move-for-test, test, compile-samples"/>
<target name="cruise" depends="build, package"/> <!-- previously included commitPackage -->
<target name="commiter" depends="build, package"/> <!-- previously included analyze -->
<target name="init" description="Initializes build properties">
<tstamp>
<formatter property="datetime.buildtime" pattern="yyyy-MM-dd, HH:mm:ss" />
</tstamp>
<delete dir="${build.base}"/>
<mkdir dir="${build.dir}" />
<echo message="Current Directory: ${project::get-base-directory()}"/>
</target>
<target name="clean" description="delete build artifacts">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="version" description="mark AssemblyInfo builds with the build number">
<!-- TODO: Needs re-writing for git -->
</target>
<target name="commonassemblyinfo" depends="version, init">
<echo message="MARKING THIS BUILD AS VERSION ${project.fullversion}" />
<delete file="${solution.dir}/CommonAssemblyInfo.cs" failonerror="false"/>
<asminfo output="${solution.dir}/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyFileVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright © ${company.name} 2007-${datetime::get-year(datetime::now())}" />
<attribute type="AssemblyProductAttribute" value="${project::get-name()} 1.5 RC" />
<attribute type="AssemblyCompanyAttribute" value="${company.name}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.config}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.fullversion}" />
</attributes>
<references>
<include name="System.dll" />
</references>
</asminfo>
</target>
<target name="compile" depends="init">
<echo message="Build Directory is ${build.dir}" />
<exec program="${msbuild.path}" commandline="${solution.file} /t:Clean /p:Configuration=${project.config} /v:q" workingdir="." />
<exec program="${msbuild.path}" commandline="${solution.file} /t:Rebuild /p:Configuration=${project.config} /v:q" workingdir="." />
</target>
<target name="move-for-test">
<delete dir="${build.dir}"/>
<copy todir="${build.dir}" flatten="true">
<fileset basedir="${solution.dir}">
<include name="/**/bin/${project.config}/**" />
<include name="*.config"/>
</fileset>
</copy>
<copy todir="${build.dir}/IncludeHandling">
<fileset basedir="${solution.dir}/MvcContrib.UnitTests/IncludeHandling">
<include name="**/*.xml" />
<include name="**/*.txt" />
</fileset>
</copy>
</target>
<target name="test" depends="init" if="${runtests}">
<delete dir="${results.dir}" if="${directory::exists('${results.dir}')}" verbose="true" />
<mkdir dir="${results.dir}"/>
<exec program="${nunit.path}"
commandline="${build.dir}/MvcContrib.UnitTests.dll /xml:${results.dir}\TestResult.xml"
workingdir="." />
<!--<nunit2 failonerror="true" verbose="true">
<formatter type="Xml" outputdir="${results.dir}" usefile="true" extension=".xml"/>
<formatter type="Plain" />
<test assemblyname="${build.dir}/MVCContrib.UnitTests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
</nunit2>-->
</target>
<target name="move-for-samples">
<delete dir="${samples.dir}\bin" />
<copy todir="${samples.dir}\bin" flatten="true">
<fileset basedir="${build.dir}">
<include name="/**/*.dll" />
</fileset>
</copy>
</target>
<target name="compile-samples" depends="init, move-for-samples">
<echo message="Build Directory is ${build.dir}" />
<exec program="${msbuild.path}" commandline="${samples.dir}\MvcContrib.TestHelper\MvcContrib.TestHelper.Sample.sln /t:Clean /p:Configuration=${project.config} /v:q" workingdir="." />
<exec program="${msbuild.path}" commandline="${samples.dir}\MvcContrib.TestHelper\MvcContrib.TestHelper.Sample.sln /t:Rebuild /p:Configuration=${project.config} /v:q" workingdir="." />
</target>
<target name="release" depends="version document">
<exec program="bin\codeplex\CreateRelease.exe"
commandline=""RC - ${project.fullversion}""
workingdir="." />
</target>
<target name="merge">
<exec program="bin\ilmerge\ilmerge.exe"
commandline="/t:library /out:src\MvcContrib.TestHelper.WatiN\bin\${project.config}\MvcContrib.WatiN.dll .\src\MvcContrib.TestHelper.WatiN\bin\${project.config}\MvcContrib.TestHelper.WatiN.dll .\src\MvcContrib.TestHelper.WatiN\bin\${project.config}\watin.core.dll .\src\MvcContrib.TestHelper.WatiN\bin\${project.config}\MvcContrib.TestHelper.dll"
workingdir="." />
</target>
<target name="package" depends="merge">
<!-- TODO: How do we generate ChangeLog now that we're using git?-->
<!--
MvcContrib
license
MvcContrib dll and pdb
MvcContrib.TestHelpers dll and pdb
QuickStart.txt
MvcContrib.Extras
make a new dir for release.
include subfolders
bin
referenceDLLs
samples
-->
<delete dir="${build.base}/release/" failonerror="false"></delete>
<mkdir dir="${build.base}/release/" />
<property name="ContribRelease" value="${build.base}/release/MvcContrib/"/>
<mkdir dir="${ContribRelease}" />
<copy todir="${ContribRelease}" flatten="true">
<fileset basedir="${solution.dir}">
<include name="/**/bin/${project.config}/mvccontrib.dll" />
<include name="/**/bin/${project.config}/mvccontrib.xml" />
<include name="/**/bin/${project.config}/mvccontrib.testhelper.dll" />
<include name="/**/bin/${project.config}/mvccontrib.testhelper.xml" />
<include name="/**/bin/${project.config}/mvccontrib.fluenthtml.dll"/>
<include name="/**/bin/${project.config}/mvccontrib.fluenthtml.xml"/>
<include name="/**/bin/${project.config}/mvccontrib.watin.dll"/>
</fileset>
</copy>
<copy todir="${ContribRelease}" >
<fileset basedir=".">
<include name="license.txt" />
</fileset>
</copy>
<copy todir="${ContribRelease}" >
<fileset basedir=".">
<include name="changelog.txt" />
</fileset>
</copy>
<mkdir dir="${ContribRelease}Dependencies/" />
<copy todir="${ContribRelease}Dependencies/" flatten="true">
<fileset basedir="${solution.dir}">
<include name="/**/bin/${project.config}/Microsoft.Web.MVC.dll" />
<include name="/**/bin/${project.config}/Rhino.Mocks.Dll" />
</fileset>
</copy>
<mkdir dir="${ContribRelease}InputBuilderTemplates/" />
<copy todir="${ContribRelease}InputBuilderTemplates/" flatten="true">
<fileset basedir="${solution.dir}">
<include name="MvcContrib/UI/InputBuilder/Views/InputBuilders/*.*" />
</fileset>
</copy>
<zip zipfile="build/MVCContrib.release.zip" includeemptydirs="false" >
<fileset basedir="${ContribRelease}">
<include name="license.txt" />
<include name="**/*.*"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
</fileset>
</zip>
<property name="ExtrasRelease" value="${build.base}/release/Extras/"/>
<mkdir dir="${ExtrasRelease}" />
<mkdir dir="${build.base}/release/" />
<mkdir dir="${build.base}/release/" />
<mkdir dir="${ExtrasRelease}/Bin" />
<copy todir="${ExtrasRelease}/Bin" flatten="true">
<fileset basedir="${solution.dir}">
<include name="/**/bin/${project.config}/mvccontrib**" />
</fileset>
</copy>
<mkdir dir="${ExtrasRelease}/Bin/referenceDLLs" />
<copy todir="${ExtrasRelease}/Bin/referenceDLLs" flatten="false">
<fileset basedir="bin">
<include name="AspnetMvc/*.dll" />
<include name="Boo/*.dll" />
<include name="Castle/*.dll" />
<include name="mvpxml/*.dll" />
<include name="spring.net/*.dll" />
<include name="structuremap/*.dll" />
<include name="unity/*.dll" />
</fileset>
</copy>
<mkdir dir="${ExtrasRelease}/Samples" />
<copy todir="${ExtrasRelease}/Samples" >
<fileset basedir="${solution.dir}/">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/samples/**"/>
<include name="/**samples**/**" />
</fileset>
</copy>
<copy todir="${ExtrasRelease}/Samples" >
<fileset basedir="${solution.dir}/Samples">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="/**resharper**/**"/>
<include name="/**/**" />
</fileset>
</copy>
<copy todir="${ExtrasRelease}/Samples/bin" >
<fileset basedir="${solution.dir}/Samples/bin">
<include name="*.*"/>
</fileset>
</copy>
<mkdir dir="${ExtrasRelease}/Helpers/" />
<copy todir="${ExtrasRelease}/Helpers" >
<fileset basedir="extras">
<include name="/**/**" />
</fileset>
</copy>
<copy todir="${ExtrasRelease}" >
<fileset basedir=".">
<include name="license.txt" />
</fileset>
</copy>
<copy todir="${ExtrasRelease}" >
<fileset basedir=".">
<include name="changelog.txt" />
</fileset>
</copy>
<copy todir="${ExtrasRelease}" >
<fileset basedir="./build/help">
<include name="*.chm" />
</fileset>
</copy>
<zip zipfile="build/MVCContrib.Extras.release.zip" includeemptydirs="false" >
<fileset basedir="${ExtrasRelease}">
<include name="license.txt" />
<include name="**/*.*"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
</fileset>
</zip>
<zip zipfile="build/MVCContrib.source.zip" includeemptydirs="false" >
<fileset basedir="${trunk.dir}" >
<exclude name=".git/**"/>
<!--<exclude name="**/LatestVersion/**"/>-->
<exclude name="**/build/**"/>
<exclude name="src/**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/*.resharper*"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.cache"/>
<exclude name="**/*.user"/>
<exclude name="**/_ReSharper.MVCContrib/**"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
<include name="**/*.*"/>
</fileset>
</zip>
</target>
<target name="document" >
<!-- TODO: Investigate using docu to do this -->
<!--
<unzip zipfile="bin\sandcastle\data.zip" todir="bin\sandcastle\" failonerror="false"/>
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="Documentation\DocumentationProject\MvcContrib.shfbproj" workingdir="." />
<copy file="build\Help\Output\documentation.chm" tofile="LatestVersion\MvcContribDocumentation.chm"/>
-->
</target>
</project>