forked from ninject/Ninject
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNinject.include
More file actions
285 lines (241 loc) · 13.2 KB
/
Copy pathNinject.include
File metadata and controls
285 lines (241 loc) · 13.2 KB
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?xml version="1.0" encoding="utf-8"?>
<project name="NinjectIncludes">
<property name="path.base" value="${project::get-base-directory()}"/>
<property name="path.build" value="${path.base}/build"/>
<property name="path.lib" value="${path.base}/lib"/>
<property name="path.dist" value="${path.base}/dist"/>
<property name="path.docs" value="${path.base}/docs"/>
<property name="path.src" value="${path.base}/src"/>
<property name="path.build.assemblyinfo" value="${path.src}/${build.asminfo}" dynamic="true"/>
<property name="path.tools" value="${path.base}/tools"/>
<property name="path.tools.xunit" value="${path.tools}/xunit.net"/>
<property name="path.tools.xunit.console" value="${path.tools.xunit}/xunit.console.exe" dynamic="true"/>
<property name="path.tools.moq" value="${path.tools}/moq"/>
<property name="path.tools.ncover" value="${path.tools}/ncover"/>
<property name="path.tools.git" value="${path.tools}/git"/>
<property name="product.name" value="Ninject" overwrite="false"/>
<property name="product.company" value="Enkari, Ltd." overwrite="false"/>
<property name="product.duration" value="2007-2010" overwrite="false"/>
<property name="product.description" value="Lightweight dependency injection for .NET" overwrite="false"/>
<property name="product.keyfile" value="${product.name}.snk" overwrite="false"/>
<property name="product.docfile" value="${product.name}.xml" overwrite="false"/>
<property name="product.assembly" value="${product.name}.dll" overwrite="false"/>
<property name="product.assembly.test" value="${product.name}.Tests.dll" overwrite="false"/>
<property name="version" value="2.1.0.0" overwrite="false"/>
<property name="version.major" value="${version::get-major(version::parse(version))}" dynamic="true"/>
<property name="version.minor" value="${version::get-minor(version::parse(version))}" dynamic="true"/>
<property name="version.build" value="${version::get-build(version::parse(version))}" dynamic="true"/>
<property name="version.revision" value="${version::get-revision(version::parse(version))}" dynamic="true"/>
<property name="build.version" value="${version.major}.${version.minor}.${version.build}.${version.revision}" dynamic="true"/>
<property name="build.config" value="debug" overwrite="false"/>
<property name="build.platform" value="net-3.5" overwrite="false"/>
<property name="build.asminfo" value="SharedAssemblyInfo.cs"/>
<property name="package" value="false" readonly="false" overwrite="false"/>
<property name="skip.tests" value="false" readonly="false" overwrite="false"/>
<property name="Is64BitOperatingSystem" value="false" />
<property name="Is64BitProcess" value="false" />
<property name="IsWow64Process" value="false" />
<target name="DetectOperatingSystemArchitecture" depends="DetectIfWow64Process,DetectIf64BitProcess">
<description>
This will detect whether the current Operating System is running as a 32-bit or 64-bit Operating System regardless of whether this is a 32-bit or 64-bit process.
</description>
<property name="Is64BitOperatingSystem" value="${IsWow64Process or Is64BitProcess}" />
<if test="${Is64BitOperatingSystem}">
<echo message="The operating system you are running is 64-bit." />
</if>
<if test="${not Is64BitOperatingSystem}">
<echo message="The operating system you are running is 32-bit." />
</if>
</target>
<script language="C#" prefix="PInvoke">
<references>
<include name="System.dll" />
</references>
<imports>
<import namespace="System.Diagnostics" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<code>
<![CDATA[
[DllImport("kernel32.dll")]
public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo);
[Function("IsWow64Process")]
public bool IsWow64Process()
{
bool retVal = false;
IsWow64Process(Process.GetCurrentProcess().Handle, out retVal);
return retVal;
}
]]>
</code>
</script>
<target name="DetectIfWow64Process">
<description>
Detects whether we are currently in a WoW64 process or not.
</description>
<property name="IsWow64Process" value="${PInvoke::IsWow64Process()}" />
<echo message="Setting the [IsWow64Process] property to ${IsWow64Process}." />
</target>
<target name="DetectIf64BitProcess">
<description>
Detects whether we are currently in a 32-bit or 64-bit process (not necessarily what the OS is running). Note that as of the time of this writing, this will ALWAYS return false because NAnt is compiled to run in 32-bit mode only.
</description>
<!-- This can return x86, x64, AMD64, or IA64 as of the time of this writing. This works for a 32-bit process in a 64-bit OS because the OS makes the 64-bitness transparent to the process in this environment variable. -->
<property name="Is64BitProcess" value="${environment::get-variable('PROCESSOR_ARCHITECTURE')!='x86'}" />
<echo message="Setting the [Is64BitProcess] property to ${Is64BitProcess}." />
</target>
<target name="rebuild" depends="clean, all"/>
<target name="clean">
<delete dir="${path.build}" if="${directory::exists(path.build)}"/>
<delete dir="${path.dist}" if="${directory::exists(path.dist)}"/>
</target>
<target name="create-assembly-info" depends="get-git-revision">
<echo message="##teamcity[buildNumber '${build.version}']" />
<asminfo output="${path.build.assemblyinfo}" language="CSharp">
<imports>
<import namespace="System"/>
<import namespace="System.Reflection"/>
<import namespace="System.Runtime.InteropServices"/>
</imports>
<attributes>
<attribute type="AssemblyProductAttribute" value="${product.name}: ${product.description}"/>
<attribute type="AssemblyCompanyAttribute" value="${product.company}"/>
<attribute type="AssemblyCopyrightAttribute" value="Copyright © ${product.duration} ${product.company} and contributors"/>
<attribute type="AssemblyVersionAttribute" value="${build.version}"/>
<attribute type="ComVisibleAttribute" value="false"/>
<attribute type="CLSCompliantAttribute" value="true"/>
</attributes>
</asminfo>
</target>
<target name="init" depends="create-assembly-info">
<call target="DetectOperatingSystemArchitecture"/>
<mkdir dir="${path.build}" if="${not(directory::exists(path.build))}"/>
<mkdir dir="${path.dist}" if="${not(directory::exists(path.dist))}"/>
<call target="config-build-${build.config}"/>
<call target="config-platform-${build.platform}"/>
<property name="current.path.build" value="${path.build}/${build.platform}/${build.config}"/>
<property name="current.path.build.lib" value="${path.build}/${build.platform}/${build.config}/lib"/>
<property name="current.path.build.extensions" value="${path.build}/${build.platform}/${build.config}/extensions"/>
<property name="current.path.test" value="${path.build}/${build.platform}/tests" />
<mkdir dir="${current.path.build}" if="${not(directory::exists(current.path.build))}"/>
<mkdir dir="${current.path.build.lib}" if="${not(directory::exists(current.path.build.lib))}"/>
<mkdir dir="${current.path.build.extensions}" if="${not(directory::exists(current.path.build.extensions))}"/>
<copy todir="${current.path.build}">
<fileset basedir="${path.base}">
<include name="LICENSE.txt"/>
</fileset>
</copy>
<copy todir="${current.path.build.lib}">
<fileset basedir="${path.lib}">
<include name="*.dll"/>
<include name="*.xml"/>
</fileset>
</copy>
</target>
<target name="config-build-debug">
<property name="build.debug" value="true"/>
<property name="build.optimize" value="false" overwrite="false"/>
<property name="global.build.defines" value="DEBUG,TRACE"/>
</target>
<target name="config-build-release">
<property name="build.debug" value="false"/>
<property name="build.optimize" value="true" overwrite="false"/>
<property name="global.build.defines" value="TRACE,STRONG"/>
</target>
<target name="config-platform-net-3.5">
<property name="nant.settings.currentframework" value="net-3.5"/>
<property name="build.defines" value="${global.build.defines},NET,NET_35"/>
</target>
<target name="config-platform-net-3.5-no-web">
<property name="nant.settings.currentframework" value="net-3.5"/>
<property name="build.defines" value="${global.build.defines},NET,NET_35,NO_WEB"/>
</target>
<target name="config-platform-net-4.0">
<property name="nant.settings.currentframework" value="net-4.0"/>
<property name="build.defines" value="${global.build.defines},NET,NET_40"/>
<property name="path.tools.xunit.console" value="${path.tools.xunit}/xunit.console.clr4.exe"/>
</target>
<target name="config-platform-net-4.0-no-web">
<property name="nant.settings.currentframework" value="net-4.0"/>
<property name="build.defines" value="${global.build.defines},NET,NET_40,NO_WEB"/>
<property name="path.tools.xunit.console" value="${path.tools.xunit}/xunit.console.clr4.exe"/>
</target>
<target name="config-platform-silverlight-2.0">
<property name="nant.settings.currentframework" value="silverlight-2.0"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_20,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
</target>
<target name="config-platform-silverlight-3.0">
<property name="nant.settings.currentframework" value="silverlight-3.0"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_30,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
</target>
<target name="config-platform-silverlight-4.0">
<property name="nant.settings.currentframework" value="silverlight-4.0"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_40,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
</target>
<target name="config-platform-silverlight-4.0-wp7">
<property name="nant.settings.currentframework" value="silverlight-4.0-wp7"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_40,WINDOWS_PHONE,NO_LCG,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
</target>
<target name="config-platform-netcf-3.5">
<property name="nant.settings.currentframework" value="netcf-3.5"/>
<property name="build.defines" value="${global.build.defines},NETCF,NETCF_35,NO_LCG,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
</target>
<target name="config-platform-mono-2.0">
<property name="nant.settings.currentframework" value="mono-2.0"/>
<property name="build.defines" value="${global.build.defines},NET,NET_35,MONO"/>
</target>
<target name="config-platform-mono-2.0-no-web">
<property name="nant.settings.currentframework" value="mono-2.0"/>
<property name="build.defines" value="${global.build.defines},NET,NET_35,NO_WEB,MONO"/>
</target>
<target name="test" depends="compile-tests" unless="${skip.tests}" if="${build.platform == 'net-3.5' or build.platform == 'net-4.0'}">
<exec program="${path.tools.xunit.console}" workingdir="${current.path.test}" commandline="${product.assembly.test} /html ${current.path.test}/results.html" failonerror="true"/>
<if test="${not Is64BitOperatingSystem}">
<exec verbose="true" program="${path.tools.ncover}/ncover.console.exe" workingdir="${current.path.test}"
commandline=""${path.tools.xunit.console}" "${product.assembly.test}" //reg //w "." //x "coverage.xml""/>
</if>
</target>
<target name="package-all" depends="all package-bin package-source" />
<target name="package-bin" depends="all">
<mkdir dir="${path.dist}" if="${not(directory::exists(path.dist))}"/>
<zip zipfile="${path.dist}\${product.name}-${build.version}-${build.config}-${build.platform}.zip" ziplevel="9">
<fileset basedir="${current.path.build}">
<include name="**/*.*"/>
</fileset>
</zip>
</target>
<target name="package-source" depends="create-assembly-info">
<mkdir dir="${path.dist}" if="${not(directory::exists(path.dist))}"/>
<zip zipfile="${path.dist}\${product.name}-${build.version}-source.zip" ziplevel="9">
<fileset basedir="${path.base}">
<include name="lib/*.*"/>
<include name="**/*.cs"/>
<include name="**/*.csproj"/>
<include name="**/*.sln"/>
<include name="**/*.txt"/>
<include name="**/*.build"/>
<include name="**/*.include"/>
<include name="**/*.snk"/>
</fileset>
</zip>
</target>
<target name="revert">
<echo message="Reverting version info"/>
<exec
program="${path.tools.git}/git.exe"
commandline='checkout "${path.build.assemblyinfo}"'
failonerror="false"/>
</target>
<target name="get-git-revision">
<property name="temp.revision.file" value="RevisionNr.tmp" />
<exec
program="${path.tools.git}/git.exe"
commandline='describe --long'
failonerror="true"
output="${temp.revision.file}"/>
<loadfile file="${temp.revision.file}" property="actual.git.revision"/>
<regex pattern=".*-(?<gitrevisionnumber>\d+)-.*" input="${actual.git.revision}"/>
<property name="version.revision" value="${gitrevisionnumber}" overwrite="true" />
<delete file="${temp.revision.file}" failonerror="false"/>
</target>
</project>