-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHiro.build
214 lines (190 loc) · 8.81 KB
/
Hiro.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
<?xml version="1.0" ?>
<project name="Hiro" default="test" xmlns="http://nant.sf.net/schemas/nant.xsd">
<property name="build.dir" value="build" />
<property name="library.dir" value="lib"/>
<property name="target.framework" value="net-3.5" readonly="false" />
<property name="ilmerge.dir" value="C:\Program Files\Microsoft\ILMerge"/>
<property name="ilmerge.executable.file" value="${path::combine(ilmerge.dir, 'ilmerge.exe')}"/>
<property name="ilmerge.exists" value="${file::exists(ilmerge.executable.file)}"/>
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="debug" value="false"/>
<property name="include.pdb.files" value="false"/>
<!-- User targets -->
<target name="clean" description="Delete Automated Build artifacts">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}"/>
</target>
<target name="net-2.0" description="Compiles the core project assembly and targets the .NET Framework v2.0">
<property name="target.framework" value="net-2.0" />
<call target="compile-core"/>
</target>
<target name="net-3.5" description="Compiles the core project assembly and targets the .NET Framework v3.5">
<property name="target.framework" value="net-3.5" />
<call target="compile-core"/>
</target>
<target name="merge" depends="clean, compile, run-unit-tests">
<msbuild project="src\ILMerge.MSBuild">
<property name="TargetFramework" value="net-2.0"/>
</msbuild>
<msbuild project="src\ILMerge.MSBuild">
<property name="TargetFramework" value="net-3.5"/>
</msbuild>
</target>
<target name="compile-container-interfaces" description="Compiles the container interface assembly">
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}"/>
<property name="output.dir" value="..\..\${build.dir}\${target.framework}"/>
<mkdir dir="${output.dir}" unless="${directory::exists(output.dir)}"/>
<msbuild project="src\Hiro.Containers\Hiro.Containers.csproj">
<property name="Configuration" value="AutomatedDebug"/>
<property name="OutputPath" value="${output.dir}"/>
<property name="DocumentationFile" value="${output.dir}\Hiro.Containers.XML"/>
</msbuild>
</target>
<target name="compile-core" depends="compile-container-interfaces" description="Compiles the core project assembly">
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}"/>
<property name="output.dir" value="${build.dir}\${target.framework}"/>
<mkdir dir="${output.dir}" unless="${directory::exists(output.dir)}"/>
<csc target="library" doc="${output.dir}\Hiro.Core.xml" noconfig="true" output="${output.dir}\Hiro.Core.dll" debug="${debug}">
<sources>
<include name="src/Core/**/*.cs" />
</sources>
<references>
<include name="System.dll" />
<include name="System.Core.dll" if="${target.framework == 'net-3.5'}"/>
<include name="System.Data.dll"/>
<include name="System.Xml.dll" />
<include name="${output.dir}\Hiro.Containers.dll"/>
<include name="${library.dir}\common\LinFu.Finders.dll"/>
<include name="${library.dir}\common\Iesi.Collections.dll"/>
<include name="${library.dir}\common\Iesi.Collections.Generic.dll"/>
<include name="${library.dir}\common\NGenerics.dll"/>
<include name="${library.dir}\${target.framework}\Mono.Cecil.dll"/>
<include name="${library.dir}\${target.framework}\LinqBridge.dll" if="${target.framework == 'net-2.0'}"/>
</references>
</csc>
<copy todir="${output.dir}" flatten="true">
<fileset basedir="${library.dir}">
<include name="common\Iesi.Collections.dll"/>
<include name="common\Iesi.Collections.Generic.dll"/>
<include name="common\LinFu.Finders.dll"/>
<include name="common\NGenerics.dll"/>
<include name="${target.framework}\Mono.Cecil.dll"/>
<include name="${target.framework}\LinqBridge.dll" if="${target.framework == 'net-2.0'}"/>
</fileset>
</copy>
</target>
<target name="compile-sample-assembly" depends="create-output-directories">
<property name="debug.dir" value="${build.dir}\Debug"/>
<property name="unittest.dir" value="${debug.dir}\UnitTests"/>
<csc target="library" noconfig="true" output="${unittest.dir}\SampleAssembly.dll" debug="${debug}">
<sources>
<include name="src/SampleAssembly/**/*.cs" />
</sources>
<references>
<include name="System.dll" />
<include name="System.Core.dll"/>
<include name="System.Data.dll"/>
<include name="System.Xml.dll" />
<include name="${output.dir}\Hiro.Containers.dll"/>
</references>
</csc>
</target>
<target name="create-output-directories">
<property name="debug.dir" value="${build.dir}\Debug"/>
<property name="unittest.dir" value="${debug.dir}\UnitTests"/>
<property name="output.dir" value="${build.dir}\${target.framework}"/>
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}"/>
<mkdir dir="${debug.dir}" unless="${directory::exists(debug.dir)}"/>
<mkdir dir="${unittest.dir}" unless="${directory::exists(unittest.dir)}"/>
</target>
<target name="compile-unit-tests" depends="create-output-directories, compile-sample-assembly, compile-core" description="Compiles the unit tests for the core assembly">
<csc target="library" noconfig="true" output="${unittest.dir}\Hiro.UnitTests.dll" debug="${debug}">
<sources>
<include name="src/UnitTests/**/*.cs" />
</sources>
<references>
<include name="System.dll" />
<include name="System.Core.dll"/>
<include name="System.Data.dll"/>
<include name="System.Xml.dll" />
<include name="${unittest.dir}\SampleAssembly.dll"/>
<include name="${output.dir}\Hiro.Containers.dll"/>
<include name="${output.dir}\Hiro.Core.dll"/>
<include name="${library.dir}\common\LinFu.Finders.dll"/>
<include name="${library.dir}\common\Iesi.Collections.dll"/>
<include name="${library.dir}\common\Iesi.Collections.Generic.dll"/>
<include name="${library.dir}\common\NGenerics.dll"/>
<include name="${library.dir}\common\nunit.framework.dll"/>
<include name="${library.dir}\common\Moq.dll"/>
<include name="${library.dir}\${target.framework}\Mono.Cecil.dll"/>
</references>
</csc>
<copy todir="${unittest.dir}" flatten="true">
<fileset basedir="${library.dir}">
<include name="common\Iesi.Collections.dll"/>
<include name="common\LinFu.Finders.dll"/>
<include name="common\Iesi.Collections.Generic.dll"/>
<include name="common\NGenerics.dll"/>
<include name="common\nunit.framework.dll"/>
<include name="common\Moq.dll"/>
<include name="${target.framework}\Mono.Cecil.dll"/>
</fileset>
</copy>
<copy todir="${unittest.dir}" flatten="true">
<fileset basedir="${output.dir}">
<include name="Hiro.Containers.dll"/>
<include name="Hiro.Core.dll"/>
</fileset>
</copy>
</target>
<target name="compile" description="Compiles using the AutomatedDebug Configuration">
<call target="net-2.0"/>
<call target="net-3.5"/>
</target>
<target name="test" depends="compile, run-unit-tests"
description="Compile and Run Tests">
<call target="merge" if="${ilmerge.exists}"/>
<property name="build.dir.path" value="${path::get-full-path(build.dir)}"/>
<echo message="Please Note: The compiled Hiro binaries have been copied to the following directories:"/>
<echo message="${path::combine(build.dir.path, 'net-2.0')}"/>
<echo message="${path::combine(build.dir.path, 'net-3.5')}"/>
</target>
<target name="full" depends="clean, test, dist" description="Compiles, tests, and produces distributions" />
<!-- Internal targets -->
<target name="run-unit-tests" depends="compile-unit-tests">
<property name="debug.dir" value="${build.dir}\Debug"/>
<property name="unittest.dir" value="${debug.dir}\UnitTests"/>
<mkdir dir="${build.dir}\test-reports" />
<exec program="tools\nunit\nunit-console.exe" workingdir="${build.dir}\Debug\UnitTests">
<arg value=""Hiro.UnitTests.dll" "/xml:..\..\test-reports\UnitTests.xml" "/nologo""/>
</exec>
</target>
<target name="dist" depends="clean, compile">
<mkdir dir="${build.dir}\dist" />
<mkdir dir="${build.dir}\dist\net-2.0" />
<mkdir dir="${build.dir}\dist\net-3.5" />
<!--Copy the .NET 2.0 build files-->
<copy todir="${build.dir}\dist\net-2.0">
<fileset basedir="${build.dir}\net-2.0">
<include name="**\*"/>
</fileset>
</copy>
<!--Copy the .NET 3.5 build files-->
<copy todir="${build.dir}\dist\net-3.5">
<fileset basedir="${build.dir}\net-3.5">
<include name="**\*"/>
</fileset>
</copy>
<!--Copy the license file-->
<copy todir="${build.dir}\dist">
<fileset basedir="${build.dir}\..">
<include name="Hiro.License.txt"/>>
</fileset>
</copy>
<zip zipfile="${build.dir}\Hiro.zip">
<fileset basedir="${build.dir}\dist">
<include name="**\*" />
</fileset>
</zip>
<delete dir="${build.dir}\dist"/>
</target>
</project>