forked from quartznet/quartznet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Quartz.build
264 lines (208 loc) · 10.3 KB
/
Quartz.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
<project name="Quartz.NET" xmlns="http://nant.sf.net/release/0.90/nant.xsd" default="build">
<!-- what kind of build -->
<property name="build.configuration" value="debug" overwrite="false" />
<property name="build.optimize" value="false" overwrite="false" />
<property name="build.debug" value="Full" overwrite="false" />
<property name="build.keyfile" value="quartz.public.snk" overwrite="false" />
<property name="nuget.location" value="tools/NuGet/NuGet.exe" />
<property name="msbuild.location" value="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" />
<property name="node.location" value="C:\Program Files\nodejs" />
<property name="npm.location" value="${node.location}\npm.cmd" overwrite="false" />
<property name="jspm.location" value="C:\Users\${environment::get-user-name()}\AppData\Roaming\npm\jspm.cmd" overwrite="false" />
<property name="grunt.location" value="C:\Users\${environment::get-user-name()}\AppData\Roaming\npm\grunt.cmd" overwrite="false" />
<property name="version.major" value="2" overwrite="false" />
<property name="version.minor" value="4" overwrite="false" />
<property name="version.revision" value="0" overwrite="false" />
<property name="version.build" value="${environment::get-variable('BUILD_NUMBER')}" overwrite="false" if="${environment::variable-exists('BUILD_NUMBER')}" />
<property name="version.build" value="0" overwrite="false" unless="${environment::variable-exists('BUILD_NUMBER')}" />
<property name="version.readable" value="${version.major}.${version.minor}" />
<property name="version.readable" value="${version.readable}.${version.revision}" if="${version.revision != '0'}" />
<property name="git.hash" value="${environment::get-variable('GIT_COMMIT')}" overwrite="false" if="${environment::variable-exists('GIT_COMMIT')}" />
<property name="git.hash" value="" overwrite="false" unless="${environment::variable-exists('GIT_COMMIT')}" />
<!-- whether to use C5 collection library -->
<property name="c5-collections" value="true" overwrite="false" />
<property name="build.defines" value="DEBUG,TRACE" />
<property name="net-40.reference.assembly.path" value="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" overwrite="false" />
<call target="init" />
<target name="init">
<!-- Check target framework -->
<property name="target.framework" value="4.0" overwrite="false" />
<!-- set global target framework to 4.0 by default -->
<property name="nant.settings.currentframework" value="net-4.0" />
<!-- Set directories -->
<property name="dir.src" value="src/" />
<property name="dir.server.src" value="server/"/>
<property name="dir.doc" value="doc/" />
<property name="dir.build" value="build/${target.framework}/${build.configuration}" />
<property name="dir.deployment" value="deployment/${target.framework}" />
<mkdir dir="${dir.build}" />
</target>
<target name="restore-nuget-packages" unless="${target::has-executed('restore-nuget-packages')}">
<exec program="${nuget.location}" commandline="restore Quartz.sln" />
</target>
<target name="restore-web-modules">
<fail message="jspm not installed, run: npm install -g jspm" unless="${file::exists(jspm.location)}" />
<property name="webdir" value="${project::get-base-directory()}\src\Quartz.Web\App" />
<echo message="Operating in directory ${webdir}" />
<!-- for some reason the installation breaks, better delete and reinstall -->
<delete dir="${webdir}/node_modules" />
<exec
program="${jspm.location}"
workingdir="${webdir}">
<arg value="install"/>
</exec>
</target>
<target name="build" depends="restore-nuget-packages generate-assembly-info">
<exec
program="${msbuild.location}"
commandline="/p:Configuration=Release /v:m /m Quartz.sln"
/>
</target>
<target name="build-quartz" >
<fail if="${file::exists(build.keyfile) == false}" message="You need to generate quartz.net.snk file before building. Use command 

	 sn -k quartz.net.snk" />
<mkdir dir="${buildoutputbasedir}" />
<property name="target.dir" value="${buildoutputbasedir}" />
<property name="client-profile" value="false" />
<call target="compile-quartz" />
</target>
<target name="generate-assembly-info">
<asminfo output="src/AssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="AssemblyConfigurationAttribute" value="net-${target.framework}.win32; ${build.configuration}" />
<attribute type="AssemblyProductAttribute" value="Quarz.NET ${version.readable} for .NET ${target.framework}" />
<attribute type="AssemblyDescriptionAttribute" value="Quartz Scheduling Framework for .NET" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright 2001-2014 Marko Lahma" />
<attribute type="AssemblyTrademarkAttribute" value="Apache License, Version 2.0" />
<attribute type="AssemblyCompanyAttribute" value="http://www.quartz-scheduler.net/" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="true" />
<attribute type="AssemblyVersionAttribute" value="${version.major}.${version.minor}.${version.revision}.0" />
<attribute type="AssemblyInformationalVersionAttribute" value="${version.major}.${version.minor}.${version.revision}.${version.build} / ${git.hash}" />
<attribute type="AssemblyDelaySignAttribute" value="false" />
<attribute type="System.Security.AllowPartiallyTrustedCallersAttribute" />
<attribute type="System.Security.SecurityRulesAttribute" value="System.Security.SecurityRuleSet.Level1" asis="true" />
</attributes>
</asminfo>
</target>
<target name="unit">
<call target="unit-internal" />
</target>
<target name="unit-internal" depends="build">
<property name="test.dll" value="${buildoutputbasedir}.Tests.Unit/Quartz.Tests.Unit.dll" />
<echo message="Testing dll: ${test.dll}" />
<nunit2 verbose="true" failonerror="false">
<formatter type="Plain" />
<test assemblyname="${test.dll}" />
</nunit2>
</target>
<target name="clean">
<echo message="Cleaning old compiled dlls..." />
<delete failonerror="false" dir="./build" />
<delete failonerror="false" dir="./CloverBuild" />
<delete failonerror="false" dir="./CloverReport" />
<delete failonerror="false" dir="./package" />
<delete failonerror="false" file="./Quartz-x.x.zip" />
<echo message="Cleaning old temporary build files (obj and bin dirs)..." />
<delete>
<fileset>
<include name="${dir.src}/**/obj/**" />
<include name="${dir.src}/**/bin/**" />
</fileset>
</delete>
</target>
<target name="apidoc">
<property name="dir.ndoc.target.binaries" value="${dir.build}/Quartz/" />
<echo message="Building documentation...." />
<exec
program="${msbuild.location}"
commandline="/p:Configuration=Release Quartz.sln"
/>
<exec
program="${msbuild.location}"
commandline="/p:CleanIntermediates=True /p:Configuration=Release /p:CustomBeforeSHFBTargets=doc/quartznet-2.0.targets "doc/quartznet.shfbproj""
/>
<call target="apidoc-post-process" />
</target>
<target name="apidoc-post-process">
<!-- far easier just to post-process html files than try to get SHFB to work with html in footer -->
<loadfile file="doc/header.template" property="header.content" failonerror="true" />
<loadfile file="doc/footer.template" property="footer.content" failonerror="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="build/apidoc/**/*.htm" />
<include name="build/apidoc/**/*.html" />
</items>
</in>
<do>
<loadfile file="${filename}" property="file.to.process">
<filterchain>
<replacetokens>
<token key="FOOTER" value="${footer.content}" />
<token key="HEADER" value="${header.content}" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="${filename}">${file.to.process}</echo>
</do>
</foreach>
</target>
<target name="package-release">
<call target="init" />
<property name="build.configuration" value="release" />
<property name="build.optimize" value="true" />
<property name="build.debug" value="PdbOnly" />
<property name="build.defines" value="TRACE,STRONG" />
<property name="build.keyfile" value="quartz.net.snk" />
<call target="clean" />
<call target="build" />
<delete dir="package" failonerror="false" />
<mkdir dir="package" />
<mkdir dir="package/database" />
<mkdir dir="package/src" />
<mkdir dir="package/server" />
<copy todir="package">
<fileset>
<include name="${dir.src}/**" />
<include name="${dir.server.src}/**" />
<include name="build/**/Quartz/**" />
<include name="database/**" />
<include name="lib/**" />
<include name="*.sln" />
<include name="*.txt" />
<include name="*.build" />
<exclude name="lib/other" />
<exclude name="**/.svn/**" />
<exclude name="**/_svn/**" />
<exclude name="**/*.suo" />
<exclude name="**/*.user" />
<exclude name="**/obj/**" />
</fileset>
</copy>
<copy todir="package/server/bin/4.0" flatten="true">
<fileset>
<include name="build/4.0/${build.configuration}/Quartz.Server/**" />
</fileset>
</copy>
<copy todir="package/doc/xml" flatten="true">
<fileset>
<include name="src/**/job_scheduling_data*.xsd" />
</fileset>
</copy>
<copy file="src/Quartz.Tests.Unit/Xml/TestData/RichConfiguration.xml" tofile="package/doc/xml/quartz_sample.xml" />
<!-- sorry *nix folks, couldn't get move to work as expected.. -->
<exec program="cmd" commandline="/c move package\build package\bin" />
<zip zipfile="Quartz.NET-${version.readable}.zip">
<fileset basedir="package">
<include name="**/*" />
</fileset>
</zip>
<exec program="${nuget.location}" commandline="pack Quartz.nuspec -Version ${version.readable}" />
</target>
</project>