forked from Particular/NServiceBus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nant.build
741 lines (630 loc) · 30.8 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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
<?xml version="1.0" encoding="utf-8"?>
<project name="NServiceBus" default="build" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="solution.dir" value="src"/>
<property name="trunk.dir" value="."/>
<property name="company.name" value="NServiceBus"/>
<property name="bin.dir" value="bin" />
<property name="lib.dir" value="lib" />
<property name="tools.dir" value="tools" />
<property name="build.base" value="build"/>
<property name="project.version" value="3.0.0" />
<property name="file.version" value="${project.version}.0000" dynamic="true"/>
<property name="release.dir" value="${trunk.dir}\release"/>
<property name="binaries.dir" value="${trunk.dir}\binaries"/>
<property name="output.dir" value="${build.base}\output"/>
<property name="test.dir" value="${build.base}\test"/>
<property name="artifacts.dir" value="artifacts"/>
<property name="merge.dir" value="${build.base}/merge"/>
<property name="main.build.dir" value="${build.base}\nservicebus"/>
<property name="core.build.dir" value="${build.base}\nservicebus.core"/>
<property name="host.build.dir" value="${build.base}\host"/>
<property name="container.build.dir" value="${build.base}\containers"/>
<property name="container.output.dir" value="${output.dir}\containers"/>
<property name="Is64BitOperatingSystem" value="false" />
<property name="Is64BitProcess" value="false" />
<property name="IsWow64Process" value="false" />
<property name="architecture" value="x86" dynamic="true" />
<property name="build.dir.absolutepath" value="${path::get-full-path(build.base)}" />
<property name="include.dependencies" value="true" dynamic="true" />
<property name="include_azure" value="false" dynamic="true" />
<property name="servicehosting.version" value="" dynamic="true" />
<property name="project.config" value="release" />
<property name="targetframework" value="net-4.0" dynamic="true" />
<property name="msbuild" value="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe" dynamic="true" />
<property name="msbuild.targetframework" value="/p:TargetFrameworkVersion=v3.5 /ToolsVersion:3.5" dynamic="true" />
<property name="ilmerge.targetframework" value="" dynamic="true" />
<property name="nunit.targetframework" value="" dynamic="true" />
<property name="coreswitch" value="NET35" dynamic="true" />
<if test="${targetframework == 'net-4.0'}">
<property name="nunit.targetframework" value="/framework=4.0"/>
<property name="coreswitch" value="NET40"/>
</if>
<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}">
<property name="architecture" value="x64" />
</if>
</target>
<script language="C#" prefix="MyWin32Calls">
<code>
<![CDATA[
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo);
[Function("IsWow64Process")]
public bool IsWow64Process()
{
bool retVal = false;
IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out retVal);
return retVal;
}
]]>
</code>
<references>
<include name="System.dll" />
</references>
</script>
<target name="DetectIfWow64Process">
<description>
Detects whether we are currently in a WoW64 process or not.
</description>
<property name="IsWow64Process" value="${MyWin32Calls::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>
<readregistry property="servicehosting.version" key="SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0\FullVersion" hive="LocalMachine" failonerror="false"/>
<target name="build" depends="build_src,test,compile_tools,compile_msmqutils,prepare_binaries,compile_samples"/>
<target name="build_src" depends="clean, init, commonassemblyinfo, compile_main,compile_core,compile_containers,compile_webservicesintegration,compile_nhibernate,compile_azure,compile_hosts,compile_hosts32,compile_azure_hosts"/>
<target name="init" depends="DetectOperatingSystemArchitecture" description="Initializes build properties">
<tstamp>
<formatter property="datetime.buildtime" pattern="yyyy-MM-dd, HH:mm:ss" />
</tstamp>
<echo message="Creating build dir: ${build.base}"/>
<delete dir="${build.base}"/>
<mkdir dir="${build.base}"/>
<echo message="Current Directory: ${project::get-base-directory()}"/>
<echo message="${architecture}" />
<copy todir="${lib.dir}\sqlite" overwrite="true">
<fileset basedir="${lib.dir}\sqlite\${architecture}">
<include name="*.*" />
</fileset>
</copy>
<if test="${targetframework == 'net-4.0'}">
<property name="netfx.installroot" value="" dynamic="true" />
<readregistry property="netfx.installroot" key="SOFTWARE\Microsoft\.NETFramework\InstallRoot" hive="LocalMachine" />
<echo message="Netfx in: ${netfx.installroot}" />
<property name="netfx.current" value="${netfx.installroot}v4.0.30319"/>
<property name="msbuild" value="${netfx.current}\msbuild.exe"/>
<echo message=".Net 4.0 build requested - ${msbuild}" />
<property name="ilmerge.targetframework" value="/targetplatform:v4,${netfx.current}" />
<property name="msbuild.targetframework" value="/p:TargetFrameworkVersion=v4.0 /ToolsVersion:4.0"/>
</if>
</target>
<target name="clean" description="delete build artifacts">
<delete dir="${build.base}" failonerror="false" />
</target>
<target name="commonassemblyinfo" depends="init">
<property name="assembly.version" value="${project.version}.0" />
<if test="${property::exists('build.number')}">
<property name="file.version" value="${project.version}.${build.number}"/>
</if>
<echo message="##teamcity[buildNumber '${file.version}']" />
<delete file="${solution.dir}/CommonAssemblyInfo.cs" failonerror="false"/>
<asminfo output="${solution.dir}/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
<import namespace="System.Security" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
<attribute type="AssemblyFileVersionAttribute" value="${file.version}" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright © ${company.name} 2007-${datetime::get-year(datetime::now())}" />
<attribute type="AssemblyProductAttribute" value="${project::get-name()}" />
<attribute type="AssemblyCompanyAttribute" value="${company.name}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.config}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${file.version}" />
<!-- TODO : Figure out how to handle non trusted callers i .net 4.0 -->
<if test="${targetframework != 'net-4.0'}">
<attribute type="AllowPartiallyTrustedCallersAttribute" asis="true" />
</if>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="true" />
</attributes>
<references>
<include name="System.dll" />
</references>
</asminfo>
</target>
<target name="compile_main" depends="init">
<!-- NServiceBus -->
<foreach item="String"
in="core"
delim=","
property="pathToBuild">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\nservicebus\ ${msbuild.targetframework}"
workingdir="${solution.dir}\${pathToBuild}" />
</foreach>
<property name="nservicebus.assemblies" value="${main.build.dir}\NServiceBus.dll" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${main.build.dir}\NServiceBus.*.dll" />
</items>
</in>
<do>
<property name="nservicebus.assemblies" value="${nservicebus.assemblies} ${filename}"/>
</do>
</foreach>
<!-- Create the merged NServiceBus.dll-->
<mkdir dir="${output.dir}" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:${output.dir}\NServiceBus.dll ${nservicebus.assemblies} /target:library /keyfile:NServiceBus.snk /xmldocs /log:build\output.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_core" depends="compile_main">
<!-- NServiceBus.Core -->
<foreach item="String"
in="unicastTransport,faults,utils,ObjectBuilder,messageInterfaces,impl\messageInterfaces,config,logging,impl\ObjectBuilder.Common,installation,messagemutator,encryption,unitofwork,httpHeaders,masterNode,impl\installation,impl\unicast\NServiceBus.Unicast.Msmq,unicast,headers,impersonation,impl\unicast\queuing,impl\unicast\transport,impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq,impl\unicast\NServiceBus.Unicast.Subscriptions.InMemory,impl\faults,impl\encryption,impl\Serializers,databus,impl\Sagas,impl\master,impl\SagaPersisters\InMemory,impl\SagaPersisters\RavenSagaPersister,impl\unicast\NServiceBus.Unicast.Subscriptions.Raven,integration,impl\databus,distributor,gateway,impl\licensing"
delim=","
property="pathToBuild">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\nservicebus.core\ ${msbuild.targetframework} /p:DefineConstants=${coreswitch}"
workingdir="${solution.dir}\${pathToBuild}" />
</foreach>
<!-- Create list of all "core" assemblies -->
<property name="nservicebus.coreassemblies" value="${core.build.dir}\NServiceBus.Objectbuilder.dll" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${core.build.dir}\NServiceBus.**.dll" />
<exclude name="${core.build.dir}\**Tests.dll" />
<!-- NServiceBus.Objectbuilder.dll needs to be first in the list to be the "primary assembly so it's added explicitly-->"
<exclude name="${core.build.dir}\NServiceBus.Objectbuilder.dll" />
</items>
</in>
<do>
<property name="nservicebus.coreassemblies" value="${nservicebus.coreassemblies} ${filename}"/>
</do>
</foreach>
<!-- Create list of all depending assemblies that will be merged into NServiceBus.Core.dll -->
<property name="nservicebus.merged_dependencies" value="" dynamic="true" />
<if test="${include.dependencies != 'false'}">
<foreach item="File" property="filename">
<in>
<items>
<include name="${core.build.dir}\antlr3*.dll" />
<include name="${core.build.dir}\common.logging.dll"/>
<include name="${lib.dir}\common.logging.log4net.dll"/>
<include name="${core.build.dir}\Interop.MSMQ.dll" />
<include name="${core.build.dir}\AutoFac.dll"/>
<include name="${core.build.dir}\Raven*.dll" />
<include name="${core.build.dir}\NLog.dll" />
<include name="${core.build.dir}\rhino.licensing.dll" />
<include name="${core.build.dir}\Newtonsoft.Json.dll" />
<include name="${core.build.dir}\ICSharpCode.NRefactory.dll" />
<include name="${core.build.dir}\Esent.Interop.dll" />
<include name="${core.build.dir}\Lucene.Net.dll" />
<include name="${core.build.dir}\Lucene.Net.Contrib.SpellChecker.dll" />
<include name="${core.build.dir}\Lucene.Net.Contrib.Spatial.dll" />
<include name="${core.build.dir}\BouncyCastle.Crypto.dll" />
<!-- exclude until we can fix the missing dep on debugvisualizers -->
<exclude name="${core.build.dir}\Raven.Client.Debug.dll" />
<!-- exclude as this has a dependency on System.Web.Mvc 2 -->
<exclude name="${core.build.dir}\Raven.Client.MvcIntegration.dll" />
<exclude name="${core.build.dir}\**Tests.dll" />
</items>
</in>
<do>
<property name="nservicebus.merged_dependencies" value="${nservicebus.merged_dependencies} ${filename}"/>
</do>
</foreach>
</if>
<echo message="Creating the merged NServiceBus.Core.dll, Dependencies included:" />
<echo message="${nservicebus.merged_dependencies}" />
<!-- Create the merged NServiceBus.Core.dll-->
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:${output.dir}\NServiceBus.Core.dll ${nservicebus.coreassemblies} ${nservicebus.merged_dependencies} /target:library /keyfile:NServiceBus.snk /xmldocs /internalize:ilmerge.exclude /log:build\output_core.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_containers">
<!-- Containers -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\containers\ ${msbuild.targetframework}"
workingdir="${solution.dir}\impl\ObjectBuilder" />
<!-- Copy the container assemblies to the output directory -->
<copy todir="${container.output.dir}">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.Autofac.dll" />
<include name="NServiceBus.ObjectBuilder.CastleWindsor.dll" />
<include name="NServiceBus.ObjectBuilder.StructureMap.dll" />
<include name="NServiceBus.ObjectBuilder.Unity.dll" />
<include name="NServiceBus.ObjectBuilder.Ninject.dll" />
</fileset>
</copy>
</target>
<target name="compile_webservicesintegration">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\output\ ${msbuild.targetframework}"
workingdir="${solution.dir}\integration\webservices" />
</target>
<target name="compile_nhibernate" depends="compile_core">
<!-- NServiceBus.NHibernate -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\NServiceBus.NHibernate\ ${msbuild.targetframework}"
workingdir="${solution.dir}\nhibernate" />
<property name="nservicebus.nhibernate.tests" value="" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${build.dir.absolutepath}\NServiceBus.NHibernate\**Tests.dll" />
</items>
</in>
<do>
<property name="nservicebus.nhibernate.tests" value="${nservicebus.nhibernate.tests} ${filename}"/>
</do>
</foreach>
<exec program="nunit-console.exe" basedir="tools\nunit" workingdir="${build.dir.absolutepath}\NServiceBus.NHibernate\">
<arg line="${nservicebus.nhibernate.tests}" />
<arg value="${nunit.targetframework}" />
</exec>
<!-- Create list of all "NHibernate" assemblies -->
<property name="nservicebus.nhibernate" value="" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${build.dir.absolutepath}\NServiceBus.NHibernate\NServiceBus.**NHibernate**.dll" />
<exclude name="${build.dir.absolutepath}\NServiceBus.NHibernate\**Tests.dll" />
</items>
</in>
<do>
<property name="nservicebus.nhibernate" value="${nservicebus.nhibernate} ${filename}"/>
</do>
</foreach>
<echo message="Creating the merged NServiceBus.NHibernate.dll" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:${output.dir}\NServiceBus.NHibernate.dll ${nservicebus.nhibernate} /target:library /keyfile:NServiceBus.snk /xmldocs /log:build\output_nhibernate.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_azure" depends="compile_nhibernate">
<!-- NServiceBus.azure -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\azure\NServiceBus.Azure\ ${msbuild.targetframework}"
workingdir="${solution.dir}\azure" />
<property name="nservicebus.azure.tests" value="" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${build.dir.absolutepath}\azure\NServiceBus.Azure\**Tests.dll" />
</items>
</in>
<do>
<property name="nservicebus.azure.tests" value="${nservicebus.azure.tests} ${filename}"/>
</do>
</foreach>
<!--
<exec program="nunit-console.exe" basedir="tools\nunit" workingdir="${build.dir.absolutepath}\azure\NServiceBus.azure\">
<arg line="${nservicebus.azure.tests}" />
<arg value="${nunit.targetframework}" />
</exec>
-->
<!-- Create list of all "Azure" assemblies -->
<property name="nservicebus.azure" value="${build.dir.absolutepath}\azure\NServiceBus.azure\NServiceBus.SagaPersisters.Azure.Config.dll" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${build.dir.absolutepath}\azure\NServiceBus.azure\NServiceBus.**Azure**.dll" />
<include name="${build.dir.absolutepath}\azure\NServiceBus.azure\NServiceBus.**AppFabric**.dll" />
<exclude name="${build.dir.absolutepath}\azure\NServiceBus.azure\**Tests.dll" />
<exclude name="${build.dir.absolutepath}\azure\NServiceBus.azure\NServiceBus.SagaPersisters.Azure.Config.dll" />
</items>
</in>
<do>
<property name="nservicebus.azure" value="${nservicebus.azure} ${filename}"/>
</do>
</foreach>
<echo message="Creating the merged NServiceBus.azure.dll" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:${output.dir}\NServiceBus.Azure.dll ${nservicebus.azure} /target:library /keyfile:NServiceBus.snk /xmldocs /log:build\output_azure.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_hosts">
<property name="hosting.build.dir" value="${build.base}\hosting" />
<!-- Compile all hosts -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\hosting\ ${msbuild.targetframework}"
workingdir="${solution.dir}\hosting" />
<!-- Merge the windowshost and it's dependencies -->
<mkdir dir="${output.dir}\host" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/keyfile:NServiceBus.snk /out:${output.dir}\host\NServiceBus.Host.exe ${hosting.build.dir}\NServiceBus.Hosting.Windows.exe ${hosting.build.dir}\NServiceBus.Hosting.dll ${hosting.build.dir}\Microsoft.Practices.ServiceLocation.dll ${hosting.build.dir}\Magnum.dll ${hosting.build.dir}\Topshelf.dll /internalize:ilmerge.exclude /target:exe /xmldocs /log:build\output_windowshost.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_hosts32">
<property name="hosting.build.dir32" value="${build.base}\hosting32" />
<!-- Cleanup remnants of previous host compilation -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\hosting32\ ${msbuild.targetframework} /t:Clean"
workingdir="${solution.dir}\hosting" />
<!-- Compile all hosts for 32-bit execution -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:PlatformTarget=x86 /p:OutDir=${build.dir.absolutepath}\hosting32\ ${msbuild.targetframework}"
workingdir="${solution.dir}\hosting" />
<!-- Merge the windowshost and it's dependecies -->
<mkdir dir="${output.dir}\host" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/keyfile:NServiceBus.snk /out:${output.dir}\host\NServiceBus.Host32.exe ${hosting.build.dir32}\NServiceBus.Hosting.Windows.exe ${hosting.build.dir32}\NServiceBus.Hosting.dll ${hosting.build.dir32}\Microsoft.Practices.ServiceLocation.dll ${hosting.build.dir32}\Magnum.dll ${hosting.build.dir32}\Topshelf.dll /internalize:ilmerge.exclude /target:exe /xmldocs /log:build\output_windowshost32.txt ${ilmerge.targetframework}"
workingdir="." />
</target>
<target name="compile_azure_hosts">
<property name="hosting.build.dirAzure" value="${build.base}\azure\hosting" />
<!-- Compile all hosts -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\azure\hosting\ ${msbuild.targetframework}"
workingdir="${solution.dir}\azure\hosting" />
</target>
<target name="test">
<mkdir dir="${build.base}\test-reports" />
<!-- run the core tests-->
<property name="nservicebus.testassemblies" value="" dynamic="true" />
<foreach item="File" property="filename">
<in>
<items>
<include name="${core.build.dir}\*Tests.dll" />
<include name="${build.dir.absolutepath}\containers\*Tests.dll" />
<exclude name="${core.build.dir}\*FileShare.Tests.dll" />
<exclude name="${core.build.dir}\*Gateway.Tests.dll" />
<exclude name="${core.build.dir}\*Raven.Tests.dll" />
<exclude if="${servicehosting.version == '' or include_azure == 'false'} " name="${core.build.dir}\*Azure.Tests.dll" />
</items>
</in>
<do>
<property name="nservicebus.testassemblies" value="${nservicebus.testassemblies} ${filename}"/>
</do>
</foreach>
<echo message="${nservicebus.testassemblies}" />
<exec program="nunit-console.exe" basedir="tools\nunit" workingdir="${core.build.dir}">
<arg line="${nservicebus.testassemblies}" />
<arg value="${nunit.targetframework}" />
</exec>
</target>
<target name="compile_tools">
<!-- Testing -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\testing\ ${msbuild.targetframework}"
workingdir="${solution.dir}\testing" />
<exec program="nunit-console.exe" basedir="tools\nunit" workingdir="${build.dir.absolutepath}\testing\">
<arg line="NServiceBus.Testing.Tests.dll" />
<arg value="${nunit.targetframework}" />
</exec>
<mkdir dir="${output.dir}\testing" />
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:${output.dir}\testing\NServiceBus.Testing.dll ${build.base}\testing\NServiceBus.Testing.dll ${build.base}\testing\Rhino.Mocks.dll /target:library /xmldocs /internalize:ilmerge.exclude /keyfile:NServiceBus.snk /log:build\output_testing.txt ${ilmerge.targetframework}"
workingdir="." />
<!-- claims -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\claims\ ${msbuild.targetframework}"
workingdir="${solution.dir}\claims" />
<!-- timeout -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\timeout\ ${msbuild.targetframework}"
workingdir="${solution.dir}\timeout" />
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\azure\timeout\ ${msbuild.targetframework}"
workingdir="${solution.dir}\azure\timeout" />
<!-- proxy -->
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\proxy\ ${msbuild.targetframework}"
workingdir="${solution.dir}\proxy" />
<!-- Misc -->
<foreach item="String"
in="tools\management\Errors\ReturnToSourceQueue"
delim=","
property="pathToBuild">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\tools\ ${msbuild.targetframework}"
workingdir="${solution.dir}\${pathToBuild}" />
</foreach>
<!-- ilmerge dependent assemblies into XsdGenerator -->
<exec program="${lib.dir}\ilmerge.exe"
commandline="/out:..\XsdGenerator.exe XsdGenerator.exe NServiceBus.Serializers.XML.dll NServiceBus.Utils.Reflection.dll /target:exe /log:output_xsdgenerator.txt ${ilmerge.targetframework}"
workingdir="${core.build.dir}" />
<!-- copy the xsdgenerator to the tools directory -->
<copy todir="${build.base}\tools\">
<fileset basedir="${build.base}\">
<include name="XsdGenerator.exe" />
</fileset>
</copy>
</target>
<target name="compile_samples" depends="prepare_binaries">
<foreach item="String"
in="AsyncPages,FullDuplex,PubSub,Manufacturing,GenericHost,Versioning,WcfIntegration,Starbucks,SendOnlyEndpoint,DataBus,Azure\AzureBlobStorageDataBus,Distributor,Unobtrusive"
delim=","
property="pathToBuild">
<echo message="${pathToBuild}" />
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} ${msbuild.targetframework}"
workingdir="${trunk.dir}\samples\${pathToBuild}" />
</foreach>
<if test="${servicehosting.version != '' and include_azure == 'true'}">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} ${msbuild.targetframework}"
workingdir="${trunk.dir}\samples\AzureService" />
</if>
<!-- exclude the WebServiceBridge sample until we can figure out why it fails on the CI server when building 4.0 -->
<if test="${targetframework != 'net-4.0'}">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} ${msbuild.targetframework}"
workingdir="${trunk.dir}\samples\WebServiceBridge" />
</if>
</target>
<target name="compile_msmqutils" depends="commonassemblyinfo">
<exec program="${msbuild}"
commandline="/p:Configuration=${project.config} /p:OutDir=${build.dir.absolutepath}\tools\MsmqUtils\ ${msbuild.targetframework}"
workingdir="${solution.dir}\utils" />
</target>
<target name="BuildMsmqUtils" depends="compile_msmqutils">
<!-- copy the runner to the tools directory -->
<copy todir="tools\msmqutils">
<fileset basedir="${build.dir.absolutepath}\tools\MsmqUtils">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="prepare_binaries">
<delete dir="${binaries.dir}" failonerror="false"></delete>
<mkdir dir="${binaries.dir}" />
<copy todir="${binaries.dir}">
<fileset basedir="${output.dir}">
<include name="NServiceBus*.*" />
</fileset>
</copy>
<copy todir="${binaries.dir}">
<fileset basedir="${output.dir}\host">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${binaries.dir}">
<fileset basedir="${output.dir}\testing">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${binaries.dir}" flatten="true">
<fileset basedir=".">
<include name="${lib.dir}\log4net.dll" />
<include name="${tools.dir}\nunit\nunit.framework.dll" />
</fileset>
</copy>
<copy todir="${binaries.dir}">
<fileset basedir="${lib.dir}\sqlite\x86">
<include name="*.dll" />
</fileset>
</copy>
<copy todir="${binaries.dir}\x64">
<fileset basedir="${lib.dir}\sqlite\x64">
<include name="*.dll" />
</fileset>
</copy>
<!-- Prepare Containers -->
<mkdir dir="${binaries.dir}\containers\autofac" />
<copy todir="${binaries.dir}\containers\autofac">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.Autofac.dll" />
</fileset>
</copy>
<mkdir dir="${binaries.dir}\containers\castle" />
<copy todir="${binaries.dir}\containers\castle">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.CastleWindsor.dll" />
</fileset>
</copy>
<mkdir dir="${binaries.dir}\containers\structuremap" />
<copy todir="${binaries.dir}\containers\structuremap">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.StructureMap.dll" />
</fileset>
</copy>
<mkdir dir="${binaries.dir}\containers\spring" />
<copy todir="${binaries.dir}\containers\spring">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.Spring.dll" />
</fileset>
</copy>
<mkdir dir="${binaries.dir}\containers\unity" />
<copy todir="${binaries.dir}\containers\unity">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.Unity.dll" />
</fileset>
</copy>
<mkdir dir="${binaries.dir}\containers\ninject" />
<copy todir="${binaries.dir}\containers\ninject">
<fileset basedir="${container.build.dir}">
<include name="NServiceBus.ObjectBuilder.Ninject.dll" />
</fileset>
</copy>
</target>
<target name="package" depends="build">
<delete dir="${release.dir}" failonerror="false"></delete>
<mkdir dir="${release.dir}" />
<copy todir="${release.dir}">
<fileset basedir="${trunk.dir}">
<include name="binaries\**" />
</fileset>
</copy>
<copy todir="${release.dir}">
<fileset basedir="${trunk.dir}">
<include name="*.txt" />
</fileset>
</copy>
<!-- Prepare Tools -->
<copy todir="${release.dir}">
<fileset basedir="${build.base}">
<include name="tools\**" />
<exclude name="**.xml" />
<exclude name="**.pdb" />
</fileset>
</copy>
<!-- Prepare Tools -->
<copy todir="${release.dir}\processes">
<fileset basedir="${build.base}">
<include name="timeout\**" />
<include name="proxy\**" />
<include name="distributor\**" />
<include name="gateway\**" />
<exclude name="**.xml" />
<exclude name="**.pdb" />
</fileset>
</copy>
<copy todir="${release.dir}">
<fileset basedir="${trunk.dir}">
<include name="docs\**" />
</fileset>
</copy>
<copy todir="${release.dir}">
<fileset basedir="${trunk.dir}">
<include name="RunMeFirst.bat" />
<include name="samples\**" />
<exclude name="**/obj/**" />
<exclude name="**/bin/**" />
<exclude name="**/_ReSharper*/**" />
<exclude name="**.cache" />
</fileset>
</copy>
<if test="${include.dependencies != 'true'}">
<copy todir="${release.dir}\dependencies" flatten="true">
<fileset basedir="${trunk.dir}" >
<include name="${core.build.dir}\antlr*.dll" />
<include name="${core.build.dir}\common.logging.dll"/>
<include name="${lib.dir}\common.logging.log4net.dll"/>
<include name="${core.build.dir}\Interop.MSMQ.dll" />
<include name="${core.build.dir}\AutoFac.dll"/>
<include name="${core.build.dir}\Spring.Core.dll" />
<include name="${core.build.dir}\NHibernate*.dll" />
<include name="${core.build.dir}\FluentNHibernate.dll" />
<include name="${core.build.dir}\Iesi.Collections.dll" />
<include name="${core.build.dir}\LinFu*.dll" />
<exclude name="${core.build.dir}\**Tests.dll" />
</fileset>
</copy>
</if>
<delete dir="${artifacts.dir}" failonerror="false"/>
<mkdir dir="${artifacts.dir}" />
<zip zipfile="${artifacts.dir}\NServiceBus.${file.version}.zip" includeemptydirs="false" >
<fileset basedir="${release.dir}">
<include name="**"/>
</fileset>
</zip>
<delete dir="${release.dir}" failonerror="false"/>
</target>
</project>