forked from SparkViewEngine/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spark.build
349 lines (304 loc) · 14.6 KB
/
spark.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
<?xml version="1.0" encoding="utf-8"?>
<!--EXTERNAL_PROPERTIES: usdDatabaseVersion-->
<!--EXTERNAL_PROPERTIES: CCNetLabel-->
<project name="Spark" 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}\Spark.sln"/>
<property name="trunk.dir" value="."/>
<property name="company.name" value="Louis DeJardin"/>
<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="${solution.dir}\samples"/>
<property name="version.major" value="1"/>
<property name="version.minor" value="0"/>
<property name="version.build" value="1"/>
<property name="version.revision" value="0"/>
<property name="project.version" value="${version.major}.${version.minor}" dynamic="true" />
<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="ncover.path" value="${bin.dir}\ncover" />
<property name="project.copyright" value="Copyright (c) ${company.name} 2008-${datetime::get-year(datetime::now())}"/>
<property name="package.dir" value="${build.base}\package" />
<!-- 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}/"/>
<property name="out.dir" value="${project::get-base-directory()}\${build.dir}" />
<property name="dist.revision" value="${datetime::get-year(datetime::now())*10000+datetime::get-month(datetime::now())*100+ datetime::get-day(datetime::now())}"/>
<target name="build" depends="clean, version, init, commonassemblyinfo, compile, test, compile-samples"/>
<target name="cruise" depends="build, package"/>
<target name="cruise-coverage" depends="analyze"/>
<target name="commiter" depends="build, analyze, package"/>
<target name="tools" depends="init-tools, build"/>
<target name="compile-samples"/>
<target name="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}" />
<if test="${not file::exists(solution.dir + '\Tools\SparkLanguagePackage\PackageLoadKey.h')}">
<echo message="Creating placeholder PackageLoadKey.h file" />
<echo message="// this is an auto-generated placeholder file" file="${solution.dir}\Tools\SparkLanguagePackage\PackageLoadKey.h" />
</if>
<echo message="Current Directory: ${project::get-base-directory()}"/>
</target>
<target name="init-tools">
<property name="tools.solution.dir" value="src\Tools"/>
<property name="tools.solution.file" value="${tools.solution.dir}\Tools.sln"/>
</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">
<if test="${property::exists('CCNetLabel')}">
<property name="version.build" value="${CCNetLabel}"/>
<echo message="Using CruiseControl build number ${CCNetLabel}" />
</if>
<if test="${property::exists('build.number')}">
<property name="version.build" value="${build.number}"/>
<echo message="Using TeamCity build number ${build.number}" />
</if>
<property name="dist.revision" value="${project.fullversion}"/>
</target>
<target name="compile" depends="init">
<echo message="Build Directory is ${build.dir}" />
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${solution.file} /t:Clean /p:Configuration=${project.config};OutDir=${out.dir} /v:q" workingdir="." />
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${solution.file} /t:Rebuild /p:Configuration=${project.config};OutDir=${out.dir} /v:q" workingdir="." />
<if test="${property::exists('tools.solution.file')}">
<property name="wix-parameters" value="WixTargetsPath=..\..\..\bin\msbuild\Microsoft\WiX\v3.0\wix.targets;WixTasksPath=WixTasks.dll;WixToolPath=..\..\..\bin\wix"/>
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${tools.solution.file} /t:Clean /p:Configuration=${project.config};OutDir=${out.dir};${wix-parameters} /v:q" workingdir="." />
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline="${tools.solution.file} /t:Rebuild /p:Configuration=${project.config};OutDir=${out.dir};${wix-parameters};ProjectFullVersion=${project.fullversion} /v:q" workingdir="." />
</if>
</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.version}" />
<attribute type="AssemblyFileVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyCopyrightAttribute" value="${project.copyright}" />
<attribute type="AssemblyProductAttribute" value="${project::get-name()}" />
<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>
<delete file="${solution.dir}/CommonVersionInfo.h" failonerror="false"/>
<echo message="// this is an auto-generated file" file="${solution.dir}/CommonVersionInfo.h" />
<echo message='#define VERSIONINFO_VERSIONSTRING "${project.fullversion}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_MAJOR ${version.major}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_MINOR ${version.minor}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_BUILD ${version.build}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_REVISION ${version.revision}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_COPYRIGHT "${project.copyright}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_COMPANY "${company.name}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_PRODUCT "${project::get-name()}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
</target>
<target name="test" depends="init">
<delete dir="${results.dir}" if="${directory::exists('${results.dir}')}" verbose="true" />
<mkdir dir="${results.dir}"/>
<if test="${not property::exists('outputType')}">
<property name="outputType" value="Plain"/>
</if>
<nunit2 failonerror="true" verbose="true">
<formatter type="Xml" outputdir="${results.dir}" usefile="true" extension=".xml"/>
<formatter type="${outputType}" />
<test assemblyname="${build.dir}/Spark.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Web.Mvc.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/MvcContrib.SparkViewEngine.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Castle.MonoRail.Views.Spark.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Ruby.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Python.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Web.Mvc.Ruby.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
</nunit2>
</target>
<target name="package">
<!--
make a new dir for release.
include subfolders
Bin
referenceDLLs
Docs
Samples
Tools
-->
<delete dir="${package.dir}"/>
<mkdir dir="${package.dir}/" />
<mkdir dir="${package.dir}/Bin" />
<mkdir dir="${package.dir}/Bin/Dependencies" />
<mkdir dir="${package.dir}/Bin/XparkSamples" />
<mkdir dir="${package.dir}/Docs" />
<copy todir="${package.dir}" >
<fileset basedir=".">
<include name="license.txt" />
</fileset>
</copy>
<copy file="${out.dir}/SparkVsIntegration.msi"
tofile="${package.dir}/SparkVsIntegration-${dist.revision}-${project.config}.msi"
if="${property::exists('tools.solution.file')}" />
<copy todir="${package.dir}/Bin" flatten="true">
<fileset basedir="${out.dir}">
<exclude name="*Tests*"/>
<exclude name="*Demo*"/>
<include name="*spark*.dll" />
<include name="*spark*.pdb" />
<include name="xpark.*" />
</fileset>
</copy>
<copy todir="${package.dir}/Bin/XparkSamples" flatten="true">
<fileset basedir="${out.dir}/XparkSamples">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${package.dir}/Bin/Dependencies" flatten="true">
<fileset basedir="${bin.dir}">
<include name="aspnetmvc/*.*" />
<include name="ironpython/*.*" />
<include name="ironruby/*.*" />
<include name="itextsharp/*.*" />
<include name="mvccontrib/*.*" />
<include name="castle/*.*" />
<include name="nunit/nunit.framework.dll" />
</fileset>
</copy>
<get src="http://dev.dejardin.org/book/export/html/4" dest="${package.dir}/Docs/index.html"/>
<mkdir dir="${package.dir}/Samples" />
<copy todir="${package.dir}/Samples" >
<fileset basedir="${solution.dir}/">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/samples/**"/>
<include name="/**samples**/**" />
</fileset>
</copy>
<copy todir="${package.dir}/Samples" >
<fileset basedir="${solution.dir}/Samples">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="/**resharper**/**"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.user"/>
<include name="/**/**" />
</fileset>
</copy>
<!-- tools will need to be packaged a different way -->
<!--<copy todir="${package.dir}/Tools" >
<fileset basedir="${solution.dir}/Tools">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="*resharper*"/>
<exclude name="**resharper**/**"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.sln"/>
<exclude name="**/*.user"/>
<exclude name="SparkVsPackage/**"/>
<include name="/**/**" />
</fileset>
</copy>-->
<foreach item="File" property="filename">
<in>
<items basedir="${package.dir}/Samples">
<include name="/**/*.csproj" />
</items>
</in>
<do>
<echo message="Altering ${filename}" />
<loadfile file="${filename}" property="sample.csproj.contents"/>
<property name="sample.csproj.contents" value="${string::replace(sample.csproj.contents, '..\..\..\build\package\Bin', '..\..\Bin')}"/>
<echo file="${filename}" append="false" message="${sample.csproj.contents}"/>
</do>
</foreach>
<!--
<copy todir="${package.dir}/Samples/bin" >
<fileset basedir="${solution.dir}/Samples/bin">
<include name="*.*"/>
</fileset>
</copy>
<mkdir dir="${package.dir}/Helpers/" />
<copy todir="${package.dir}/Helpers" >
<fileset basedir="extras">
<include name="/**/**" />
</fileset>
</copy>
-->
<copy todir="${package.dir}/" >
<fileset basedir="./build/help">
<include name="*.chm" />
</fileset>
</copy>
<delete dir="${build.base}/dist"/>
<mkdir dir="${build.base}/dist"/>
<zip zipfile="${build.base}/dist/${project::get-name()}-${dist.revision}-${project.config}.zip" includeemptydirs="false" >
<fileset basedir="${package.dir}/">
<include name="license.txt" />
<include name="*.msi" />
<include name="**/*.*"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
</fileset>
</zip>
<zip zipfile="${build.base}/dist/${project::get-name()}-${dist.revision}-source.zip" includeemptydirs="false" >
<fileset basedir="${trunk.dir}" >
<exclude name="bin/ncover/**"/>
<exclude name="bin/ndepend/**"/>
<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.*/**"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
<exclude name="**/*.ncb"/>
<include name="**/*.*"/>
</fileset>
</zip>
</target>
</project>