-
Notifications
You must be signed in to change notification settings - Fork 4
/
nant.build
250 lines (241 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
<?xml version="1.0"?>
<project name="Cooper" default="clean">
<!--<loadtasks assembly="..\work-tool\nant\extensions\common\2.0\yui\Yahoo.Yui.Compressor.Build.Nant.dll" verbose="true" />-->
<property name="runtime" value="dotnet" dynamic="true"/>
<property name="args0" value="" dynamic="true"/>
<property name="args1" value="" dynamic="true"/>
<property name="project.config" value="${args0}" dynamic="true" />
<!--path-->
<property name="dir" value="."/>
<property name="dir.tools" value="../work-tool"/>
<property name="build.base" value="build/${project.config}"/>
<property name="build.absolutepath" value="${path::get-full-path(build.base)}" />
<property name="xpath.flag" value="/configuration/appSettings/add[@key='EnvironmentVersionFlag']/@value"/>
<property name="xpath.flag_refresh" value="/configuration/appSettings/add[@key='AutoRefreshSettingsFlag']/@value"/>
<property name="xpath.compilation" value="/configuration/system.web/compilation/@debug"/>
<property name="xpath.customErrors" value="/configuration/system.web/customErrors/@mode"/>
<property name="xpath.trace" value="/configuration/system.web/trace/@enabled"/>
<!--nuget-->
<property name="nuget" value="${path::get-full-path(dir.tools)}" />
<property name="nuget.packages" value="${dir}\packages" />
<property name="nuget.cache" value="C:\Users\${environment::get-user-name()}\AppData\Local\NuGet\Cache" />
<property name="nuget.install" value="${dir}\nuget.install.bat" />
<property name="nuget.params.install" value="${nuget} ${path::get-full-path(nuget.packages)}" />
<!--msbuild-->
<property name="msbuild" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" />
<property name="msbuild.config" value="Debug" dynamic="true"/>
<if test="${project.config=='Release'}">
<property name="msbuild.config" value="Release"/>
</if>
<property name="msbuild.params" value="/t:rebuild /p:Configuration=${msbuild.config}" />
<property name="msbuild.params.weboutput" value="/t:_CopyWebApplication /p:WebProjectOutputDir=${build.absolutepath}" />
<property name="msbuild.params.mvcoutput" value="/t:_CopyWebApplication /p:mvcbuildviews=true /p:WebProjectOutputDir=${build.absolutepath}" />
<property name="msbuild.params.output" value="/p:OutputPath=${build.absolutepath}" />
<!--xbuild for mono-->
<if test="${runtime=='mono'}">
<!--windows use xbuild.bat-->
<property name="msbuild" value="xbuild"/>
</if>
<!--NUnit-->
<property name="nunit" value="${path::get-full-path(dir.tools)}/nunit/nunit-console.exe" />
<!--clean-->
<target name="clean" description="clean build folder">
<delete dir="${build.absolutepath}"></delete>
</target>
<target name="nuget" description="nuget install and update">
<exec program="${nuget.install}"
commandline="${nuget.params.install}"
workingdir="${dir}" />
</target>
<target name="web">
<exec program="${msbuild}"
commandline="${msbuild.params} ${msbuild.params.mvcoutput}/cooper_web ${msbuild.params.output}/cooper_web/bin"
workingdir="${dir}\src\Cooper.Web" />
<if test="${runtime=='mono'}">
<!--<exec program="/Applications/MonoDevelop.app/Contents/MacOS/mdtool"
commandline="build -p:Cooper.Web.csproj"
workingdir="${dir}\src\Cooper.Web" />-->
<delete>
<fileset>
<include name="${build.absolutepath}/cooper_web/Microsoft.Web.Infrastructure.dll" />
</fileset>
</delete>
</if>
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.flag}"
value="${project.config}" />
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.flag_refresh}"
value="true" />
<if test="${msbuild.config=='Release'}">
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.compilation}"
value="false" />
<!--RemoteOnly will no error message shown-->
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.customErrors}"
value="Off" />
<!--webtrace not work compilation.debug=false-->
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.trace}"
value="false" />
</if>
<!--change scripts-->
<echo file="${build.absolutepath}\cooper_web\scripts\common.js" append="true" if="${msbuild.config=='Release'}">
<![CDATA[
debuger.isProfileEnable = debuger.enable && false;
debuger.isDebugEnable = debuger.enable && false;
debuger.isInfoEnable = debuger.enable && false;
debuger.isWarnEnable = debuger.enable && true;
debuger.isErrorEnable = debuger.enable && true;
]]>
</echo>
<!--templateflag-->
<checksum algorithm="MD5" fileext="MD5">
<fileset>
<include name="${build.absolutepath}\cooper_web\webui\task\list.htm"/>
</fileset>
</checksum>
<loadfile file="${build.absolutepath}\cooper_web\webui\task\list.htm.md5" property="md5" />
<echo file="${build.absolutepath}\cooper_web\webui\modules\cooper.js" append="true">
template_flag_tasklist='${md5}';
</echo>
<!--compress-->
<!--third-->
<javaScriptCompressor outputFile="${build.absolutepath}\cooper_web\scripts\third.js"
encodingType="UTF8">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery-1.7.2.min.js" />
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery-ui-1.8.22.custom.min.js" />
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery.json-2.3.min.js" />
<include name="${build.absolutepath}\cooper_web\content\bootstrap\js\bootstrap.min.js" />
<include name="${build.absolutepath}\cooper_web\content\js\json3.min.js" />
<include name="${build.absolutepath}\cooper_web\content\js\moment.min.js" />
<include name="${build.absolutepath}\cooper_web\content\angular\angular-1.0.1.min.js" />
</sourceFiles>
</javaScriptCompressor>
<!--base-->
<javaScriptCompressor outputFile="${build.absolutepath}\cooper_web\scripts\base.js"
encodingType="UTF8"
deleteSourceFiles="True">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\common.js" />
<include name="${build.absolutepath}\cooper_web\scripts\lang.js" />
<include name="${build.absolutepath}\cooper_web\scripts\account.js" />
</sourceFiles>
</javaScriptCompressor>
<!--change refer via md5-->
<echo file="${build.absolutepath}\cooper_web\views\shared\scripts.cshtml"></echo>
<property name="tofile" value="scripts" />
<property name="js" value="third" />
<call target="md5_js"></call>
<property name="js" value="base" />
<call target="md5_js"></call>
<!--personal-->
<javaScriptCompressor outputFile="${build.absolutepath}\cooper_web\scripts\personal.js"
compressionType="Standard"
obfuscateJavaScript="True"
preserveAllSemicolons="False"
disableOptimizations="False"
encodingType="UTF8"
lineBreakPosition="-1"
loggingType="Info"
isEvalIgnored="false">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\task.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_common.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_detail.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_row.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind_shortcuts.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_priority.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_due.js" />
<!--personal-->
<include name="${build.absolutepath}\cooper_web\scripts\taskpage.js" />
</sourceFiles>
</javaScriptCompressor>
<echo file="${build.absolutepath}\cooper_web\views\shared\scripts_personal.cshtml"></echo>
<property name="tofile" value="scripts_personal" />
<property name="js" value="personal" />
<call target="md5_js"></call>
<!--team-->
<javaScriptCompressor deleteSourceFiles="True"
outputFile="${build.absolutepath}\cooper_web\scripts\taskui.js"
compressionType="Standard"
obfuscateJavaScript="True"
preserveAllSemicolons="False"
disableOptimizations="False"
encodingType="UTF8"
lineBreakPosition="-1"
loggingType="Info"
isEvalIgnored="false">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\task.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_common.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_detail.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_row.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind_shortcuts.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_priority.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_due.js" />
<!--team-->
<include name="${build.absolutepath}\cooper_web\scripts\task_assignee.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind_team.js" />
</sourceFiles>
</javaScriptCompressor>
<javaScriptCompressor deleteSourceFiles="True"
outputFile="${build.absolutepath}\cooper_web\scripts\team.js"
compressionType="Standard"
obfuscateJavaScript="False"
preserveAllSemicolons="False"
disableOptimizations="False"
encodingType="UTF8"
lineBreakPosition="-1"
loggingType="Info"
isEvalIgnored="false">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\taskui.js" />
<!--controllers&modules-->
<include name="${build.absolutepath}\cooper_web\webui\modules\cooper.js" />
<include name="${build.absolutepath}\cooper_web\webui\controllers\Main.js" />
<include name="${build.absolutepath}\cooper_web\webui\controllers\TaskList.js" />
</sourceFiles>
</javaScriptCompressor>
<echo file="${build.absolutepath}\cooper_web\views\shared\scripts_team.cshtml"></echo>
<property name="tofile" value="scripts_team" />
<property name="js" value="team" />
<call target="md5_js"></call>
<!--hybrid-->
</target>
<target name="md5_js">
<checksum algorithm="MD5" fileext="MD5">
<fileset>
<include name="${build.absolutepath}\cooper_web\scripts\${js}.js"/>
</fileset>
</checksum>
<loadfile file="${build.absolutepath}\cooper_web\scripts\${js}.js.md5" property="md5" />
<copy outputencoding="utf-8"
file="${build.absolutepath}\cooper_web\scripts\${js}.js"
tofile="${build.absolutepath}\cooper_web\scripts\${js}-${md5}.js"/>
<echo file="${build.absolutepath}\cooper_web\views\shared\${tofile}.cshtml" append="true">
<![CDATA[
<script type="text/javascript" src="@Url.Content("~/scripts/${js}-${md5}.js")"></script>
]]>
</echo>
</target>
<target name="test_model">
<if test="${runtime=='dotnet'}">
<exec program="${msbuild}"
commandline="Cooper.Model.Test.csproj ${msbuild.params} ${msbuild.params.output}\cooper_model_test"
workingdir="${dir}\src\Cooper.Model.Test" />
<exec program="${nunit}" commandline="Cooper.Model.Test.dll" workingdir="${build.absolutepath}\cooper_model_test"/>
</if>
<if test="${runtime=='mono'}">
<exec program="${msbuild}"
commandline="Cooper.Model.Test-mono.csproj ${msbuild.params} ${msbuild.params.output}/cooper_model_test_mono"
workingdir="${dir}\src\Cooper.Model.Test" />
<exec program="mono" commandline="${nunit} Cooper.Model.Test.dll" workingdir="${build.absolutepath}\cooper_model_test_mono"/>
</if>
<!--/exclude=concurrent-->
</target>
</project>