-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSubText-CCNET.build
261 lines (218 loc) · 9.13 KB
/
SubText-CCNET.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
<?xml version="1.0" encoding="utf-8" ?>
<project xmlns="http://nant.sf.net/schemas/nant.xsd" name="SubText">
<property name="nant.settings.currentframework" value="net-2.0"/>
<property name="nant.onsuccess" value="OnSuccess" />
<target name="get-publishing-properties">
<if test="${not property::exists('CCNetArtifactDirectory')}">
<fail message="CCNetArtifactDirectory property not set, so can't create distribution files" />
</if>
<if test="${not property::exists('CCNetWorkingDirectory')}">
<fail message="CCNetWorkingDirectory property not set, so can't create distribution files" />
</if>
<if test="${not property::exists('CCNetLabel')}">
<fail message="CCNetLabel property not set, so can't create distribution files" />
</if>
<property name="dotnetfx" value="C:\WINDOWS\Microsoft.NET\Framework" />
<property name="aspnet_compiler.exe" value="${dotnetfx}\v2.0.50727\aspnet_compiler.exe" />
<property name="msbuild.exe" value="${dotnetfx}\v3.5\MSBuild.exe" />
<property name="solution.dir" value="${CCNetWorkingDirectory}\src" />
<property name="tools.dir" value="${CCNetWorkingDirectory}\tools" />
<property name="webPI.dir" value="${tools.dir}\WebPI" />
<property name="fxcop.dir" value="${tools.dir}\FxCop" />
<property name="fxcop.exe" value="${fxcop.dir}\FxCopCmd.exe" />
<property name="mbunit.exe" value="${tools.dir}\MbUnit\MbUnit.Cons.exe" />
<property name="ncoverexplorer.exe" value="${tools.dir}\NCover\NCoverExplorer.Console.exe" />
<property name="ncover.exe" value="${tools.dir}\NCover\NCover.Console.exe" />
<property name="ndepend.dir" value="${tools.dir}\NDepend" />
<property name="ndepend.exe" value="${ndepend.dir}\NDepend.Console.exe" />
<property name="ndepend.config" value="${ndepend.dir}\NDependProject.xml" />
<property name="subtext.web.bin" value="${solution.dir}\Subtext.Web\bin" />
<property name="codemetrics.output.dir" value="${CCNetWorkingDirectory}\NDependTemp" />
<!-- Directory for hosting images for specific builds -->
<property name="artifacts.assets.dir" value="${CCNetArtifactDirectory}\buildlogs\${CCNetLabel}"/>
<property name="log.dir" value="${CCNetWorkingDirectory}\logs" />
<property name="publish.dir.latest" value="${CCNetArtifactDirectory}\builds\latest" />
<property name="publish.dir.latest.web" value="${publish.dir.latest}\Subtext.Web" />
<property name="publish.dir.archive" value="${CCNetArtifactDirectory}\builds\archive" />
<property name="publish.dir.latestsource" value="${CCNetArtifactDirectory}\builds\latestsource" />
<property name="fileLabel" value="SubText-${CCNetLabel}" />
<loadtasks path="${tools.dir}\NAnt\tasks" failonerror="false" />
</target>
<!-- //TODO: Consider checking in this file after update the version -->
<target name="version" depends="get-publishing-properties">
<asminfo output="VersionInfo.Designer.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${CCNetLabel}" />
</attributes>
</asminfo>
</target>
<target name="clean" depends="get-publishing-properties">
<delete dir="${log.dir}" failonerror="false" />
<call target="clean-vs" />
</target>
<target name="clean-vs">
<foreach item="Folder" property="foldername">
<in>
<items basedir=".">
<include name="*\bin" />
<include name="*\obj" />
</items>
</in>
<do>
<delete dir="${foldername}" />
</do>
</foreach>
<mkdir dir="Subtext.Web\bin" />
</target>
<!--
Compiles Subtext using the "documentation" configuration.
This configuration is the same as DEBUG but it outputs
documentation XML files.
-->
<target name="compile-debug" depends="clean, version">
<property name="configuration" value="debug"/>
<call target="compile" />
</target>
<target name="compile-release" depends="clean, version">
<property name="configuration" value="Release"/>
<call target="compile" />
</target>
<target name="compile">
<exec program="${msbuild.exe}">
<arg value="SubtextSolution.sln"/>
<arg value="/nologo"/>
<arg value="/verbosity:normal"/>
<arg value="/t:Build"/>
<arg value="/p:Configuration=${configuration}"/>
</exec>
</target>
<!--
Compiles Subtext and runs the MbUnit tests and NCover reports.
-->
<target name="testAndCover" depends="get-publishing-properties,compile-debug">
<mkdir dir="${log.dir}" />
<ncover
commandLineExe="${mbunit.exe}"
commandLineArgs='/rnf:unittest /rt:xml /rf:"${log.dir}" UnitTests.Subtext.dll'
program="${ncover.exe}"
workingDirectory="UnitTests.Subtext\bin\${configuration}"
coverageFile="${log.dir}\ncover-temp.xml"
excludeAttributes="CoverageExcludeAttribute"
/>
<call target="util.ncoverexplorer.nant" />
</target>
<target name="reporting" depends="compile-release">
<setenv name="PATH" path="${fxcop.dir}\;%PATH%" verbose="true" />
<fxcop
projectFile="${tools.dir}\FxCop\SubtextCodeAnalysis.FxCop"
analysisReportFilename="${log.dir}\ccnet-fxcop.xml"
failonerror="false"
/>
</target>
<target name="util.ncoverexplorer.nant">
<echo message="Starting NCoverExplorer report generation..."/>
<!-- Other attributes that can be used on ncoverexplorer element: -->
<!-- failMinimum="True" would fail the build if minimum coverage not met. -->
<!-- Remove the xmlReportName and/or htmlReportName attributes to not generate. -->
<!-- Report types are 1=Module, 2=Namespace, 3=Namespace/Module. -->
<!-- Valid exclusion 'type' attributes are 'Assembly', 'Namespace' and 'Class'. -->
<ncoverexplorer program="${ncoverexplorer.exe}"
projectName="SubText"
reportType="3"
outputDir="${log.dir}"
xmlReportName="ncover.xml"
showExcluded="True">
<fileset>
<include name="${log.dir}\ncover-temp.xml"/>
</fileset>
</ncoverexplorer>
</target>
<target name="release" depends="dist.archive">
<echo message="CI Run for build number ${CCNetLabel} successfully completed" />
</target>
<target name="dist.publish.latest" depends="compile-release">
<delete dir="${publish.dir.latest.web}" failonerror="false" />
<delete dir="${publish.dir.latest}" failonerror="false" />
<mkdir dir="${publish.dir.latest}" />
<mkdir dir="${publish.dir.latest.web}" />
<call target="precompiled.deploy" />
<copy todir="${publish.dir.latest}" includeemptydirs="false">
<fileset basedir="${webPI.dir}">
<include name="installSQL.sql" />
<include name="manifest.xml" />
<include name="parameters.xml" />
<include name="readme.txt" />
</fileset>
</copy>
<attrib readonly="false" >
<fileset basedir="${publish.dir.latest}">
<include name="**/*" />
</fileset>
</attrib>
<call target="javascript.minify" />
</target>
<target name="precompiled.deploy">
<delete dir="${publish.dir.latest}\precompiled" failonerror="false" />
<mkdir dir="${publish.dir.latest}\precompiled" failonerror="false" />
<exec program="${aspnet_compiler.exe}"
commandline="-f -u -p Subtext.Web -v / ${publish.dir.latest}\precompiled"/>
<copy todir="${publish.dir.latest.web}" includeemptydirs="false">
<fileset basedir="${publish.dir.latest}\precompiled">
<include name="emoticons.txt" />
<include name="favicon.ico" />
<include name="**/*" />
<exclude name="**/*.bmp" />
<exclude name="**/*.cs"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.resx"/>
<exclude name="bin/*.xml"/>
<exclude name="**/*.csproj"/>
<exclude name="**/*.csproj.user"/>
<exclude name="**/.cvsignore"/>
<exclude name="**/.svn"/>
<exclude name="obj/**"/>
<exclude name="_Resharper.*"/>
</fileset>
</copy>
<delete dir="${publish.dir.latest}\precompiled" failonerror="false" />
</target>
<target name="javascript.minify" depends="get-publishing-properties">
<yuicompressor todir="${publish.dir.latest.web}">
<fileset basedir="${publish.dir.latest.web}">
<include name="Skins/**/*.js" />
<include name="Scripts/**/*.js" />
<include name="Skins/**/*.css" />
<include name="Scripts/**/*.css" />
</fileset>
</yuicompressor>
</target>
<target name="dist.archive" depends="dist.publish.latest">
<mkdir dir="${publish.dir.archive}" />
<zip zipfile="${publish.dir.archive}\${fileLabel}.zip">
<fileset basedir="${publish.dir.latest}">
<include name="**/*" />
<exclude name="**/*.pdb" />
</fileset>
</zip>
</target>
<target name="dist.source" depends="get-publishing-properties">
<delete dir="${publish.dir.latestsource}" failonerror="false" />
<mkdir dir="${publish.dir.latestsource}" />
<zip zipfile="${publish.dir.latestsource}\${fileLabel}.src.zip">
<fileset basedir="${solution.dir}">
<include name="**/*" />
<exclude name="**/bin/**/*" />
<exclude name="**/obj/**/*" />
</fileset>
</zip>
</target>
<target name="OnSuccess">
<echo file="${log.dir}\buildinfo.xml" append="false" failonerror="false">
<![CDATA[<buildproject>${CCNetProject}</buildproject><buildlabel>${CCNetLabel}</buildlabel>]]>
</echo>
</target>
</project>