forked from divyang4481/classless-hasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHasher.build
224 lines (181 loc) · 7.62 KB
/
Hasher.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Classless.Hasher" default="build" basedir=".">
<description>.NET Hash and Checksum Algorithm Library</description>
<!-- Project properties. -->
<property name="project.version" value="0.9" />
<!-- Build properties. -->
<property name="build.keyfile" value="c:\temp\classless.snk" />
<property name="msbuild.location" value="c:\Windows\Microsoft.NET\Framework\v3.5" />
<property name="nunit.location" value="c:\Program Files (x86)\TestDriven.NET 2.0\NUnit\2.5\net-2.0" />
<property name="build.defines" value="" />
<if test="${not property::exists('build.config')}">
<property name="build.config" value="release" />
</if>
<!-- Build configurations. -->
<target name="release" description="Perform a 'release' build.">
<echo message="Preparing for a Release build." />
<property name="build.debug" value="false" />
<property name="build.warnaserror" value="true" />
<property name="build.optimize" value="true" />
<property name="build.dir" value="${project::get-base-directory()}/build/${build.config}/${nant.settings.currentframework}" />
</target>
<target name="debug" description="Perform a 'debug' build.">
<echo message="Preparing for a Debug build." />
<property name="build.debug" value="true" />
<property name="build.warnaserror" value="false" />
<property name="build.optimize" value="false" />
<property name="build.defines" value="DEBUG" />
<property name="build.dir" value="${project::get-base-directory()}/build/${build.config}/${nant.settings.currentframework}" />
</target>
<!-- Initialize the build environment. -->
<target name="init" description="Initializes build properties.">
<echo message="Initializing build." />
<call target="${build.config}" />
<mkdir dir="${build.dir}" />
</target>
<!-- The main build target. -->
<target name="build" depends="init" description="Compiles the program.">
<echo message="Building a ${build.config} configuration with ${framework::get-description(framework::get-target-framework())} (${nant.settings.currentframework})." />
<fileset id="sourcecode">
<include name="${project::get-base-directory()}/Hasher/*.cs" />
<include name="${project::get-base-directory()}/Hasher/*/*.cs" />
</fileset>
<csc
target="library"
output="${build.dir}/${project::get-name()}.dll"
doc="${build.dir}/${project::get-name()}.xml"
debug="${build.debug}"
warnaserror="${build.warnaserror}"
define="${build.defines}"
optimize="${build.optimize}"
keyfile="${build.keyfile}"
>
<resources dynamicprefix="true" prefix="Classless">
<include name="${project::get-base-directory()}/Hasher/**.resx" />
</resources>
<sources refid="sourcecode" />
</csc>
</target>
<!-- Testing. -->
<target name="buildtest" depends="build" description="Builds the unit test suite.">
<echo message="Building the NUnit test suite." />
<fileset id="testcode">
<include name="${project::get-base-directory()}/HasherTests/*.cs" />
<include name="${project::get-base-directory()}/HasherTests/*/*.cs" />
</fileset>
<csc
target="library"
output="${build.dir}/${project::get-name()}.Tests.dll"
debug="${build.debug}"
warnaserror="${build.warnaserror}"
define="${build.defines}"
optimize="${build.optimize}"
>
<references>
<include name="${build.dir}/${project::get-name()}.dll" />
<include name="${nunit.location}/framework/nunit.framework.dll" />
</references>
<sources refid="testcode" />
</csc>
</target>
<target name="test" depends="buildtest" description="Executes the unit test suite.">
<echo message="Executing the NUnit test suite." />
<exec
program="${nunit.location}/nunit-console.exe"
commandline=""${build.dir}/${project::get-name()}.Tests.dll" /nodots /xml:"${build.dir}/${project::get-name()}.TestResults.xml""
failonerror="true"
/>
</target>
<!-- Speed Testing application. -->
<target name="buildspeedtest" depends="build" description="Builds the speed test application.">
<echo message="Building the Speed Test application." />
<fileset id="testcode">
<include name="${project::get-base-directory()}/HasherSpeedTests/*.cs" />
<include name="${project::get-base-directory()}/HasherSpeedTests/*/*.cs" />
</fileset>
<csc
target="exe"
output="${build.dir}/${project::get-name()}.SpeedTests.exe"
debug="${build.debug}"
warnaserror="${build.warnaserror}"
define="${build.defines}"
optimize="${build.optimize}"
>
<references>
<include name="${build.dir}/${project::get-name()}.dll" />
</references>
<sources refid="testcode" />
</csc>
</target>
<target name="speedtest" depends="buildspeedtest" description="Executes the speed test application.">
<echo message="Executing the Speed Test application." />
<exec
program="${build.dir}/${project::get-name()}.SpeedTests.exe"
failonerror="true"
/>
</target>
<!-- Documentation. -->
<target name="doc" depends="build" description="Generates the library documentation.">
<echo message="Generating documentation." />
<delete dir="${project::get-base-directory()}/doc" failonerror="false" />
<if test="${build.config=='release'}">
<property name="shfb.config" value="Release" />
</if>
<if test="${not property::exists('shfb.config')}">
<property name="shfb.config" value="Debug" />
</if>
<exec
program="${msbuild.location}/MSBuild.exe"
commandline="/property:HasherBuild="${build.dir}/${project::get-name()}" /property:Configuration=${shfb.config} "${project::get-base-directory()}/Hasher.shfbproj""
failonerror="true"
/>
</target>
<!-- The distribution packages. -->
<target name="dist" depends="build" description="Builds the binary distribution package.">
<echo message="Packaging binary files." />
<zip zipfile="${build.dir}/${project::get-name()}.${project.version}.zip" ziplevel="9">
<fileset basedir="${build.dir}">
<include name="**/*" />
<exclude name="*Tests.dll" />
<exclude name="*TestResults.xml" />
</fileset>
<fileset basedir="${project::get-base-directory()}">
<include name="readme.txt" />
<include name="license.txt" />
</fileset>
</zip>
</target>
<target name="distsrc" depends="init" description="Builds the source distribution package.">
<echo message="Packaging source files." />
<zip zipfile="${project::get-base-directory()}/build/${project::get-name()}.${project.version}-src.zip" ziplevel="9">
<fileset basedir="${project::get-base-directory()}">
<include name="**/*" />
<exclude name="build/**" />
<exclude name="doc/**" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
<exclude name="Hasher.suo" />
<exclude name="**/*.pidb" />
<exclude name="Hasher.userprefs" />
</fileset>
</zip>
</target>
<target name="distdoc" depends="doc" description="Builds the documentation distribution package.">
<echo message="Packaging documentation." />
<zip zipfile="${project::get-base-directory()}/build/${project::get-name()}.${project.version}-doc.zip" ziplevel="9">
<fileset basedir="${project::get-base-directory()}/doc">
<include name="**/*" />
</fileset>
<fileset basedir="${project::get-base-directory()}">
<include name="readme.txt" />
</fileset>
</zip>
</target>
<target name="distall" depends="dist,distsrc,distdoc" description="Builds all distribution packages." />
<!-- Clean house. -->
<target name="clean" description="Remove all generated files.">
<echo message="Cleaning out all previous builds." />
<delete dir="${project::get-base-directory()}/build" failonerror="false" />
<delete dir="${project::get-base-directory()}/doc" failonerror="false" />
</target>
</project>