-
-
Notifications
You must be signed in to change notification settings - Fork 377
/
Spring.build
1439 lines (1198 loc) · 60.9 KB
/
Spring.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
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" ?>
<project name="Spring.NET" default="test">
<!--
Main build targets:
===================
"test":
builds debug builds for all projects for all available target platforms
"compile-build-<framework id>":
builds all projects for a specific platform, e.g. compile-build-3.5 for net-3.5
"doc":
builds the reference and sdk documentation
"package":
builds all projects for all target platforms, builds docs and packages everything for distribution
Build properties that may be set:
=================================
"project.build.sign":
values: bool: true|false
signs all assemblies. Requires the key file $/Spring.Net.snk to be in place
"mstest.exe":
value: string, fully-qualified location of mstest.exe, for example, C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe
"vs-net.mstest.bin.dir":
value: string: location of mstest.exe, for example C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
"package.version":
values: string: a 3-part number xx.xx.xx
set the package version
"test.integration.data":
values: bool: true|false
set this to true to run integration tests that access a database
"test.integration.ems":
values: bool: true|false
set this to true to run integration tests that access TIBCO EMS
"test.integration.nms":
values: bool: true|false
set this to true to run integration tests that access ActiveMQ
"test.full":
values: bool: true|false
set this to true to run all available tests (example solutions, integration tests, etc.)
"doc.sdk":
values: bool: true|false
set this to true to use NDoc to generate API documentation. Note Spring ships with documentation generated using Document X!
Additional Remarks:
===================
*) Building Spring.Messaging.Ems
if you want to build Spring.Messaging.Ems (Tibco EMS support), you need to copy tibco.ems.dll and tibco.ems.admin.dll into '/lib/net/2.0'
*) Building Spring.Testing.Microsoft
if you want to build Spring.Testing.Microsoft (MSTest Support), you need to have VS MSTest support installed (mstest.exe)
Running Integration Tests:
==========================
*) Database Integration Tests
- you need to have an MSSQL 2005 Server instance installed and configured an alias "SPRINGQA" for this instance
- create a login "springqa" with password "springqa" and assign the 'db_sysadmin' role
on the commandline enable the "test.integration.data" flag, e.g.:
nant test -f:spring.build -D:test.integration.data=true
*) TIBCO EMS Integration Tests
- You need to have an EMS instance running at the URL tcp://localhost:7222
on the commandline enable the "test.integration.ems" flag, e.g.:
nant test -f:spring.build -D:test.integration.ems=true
*) ActiveMQ Inegration Tests
on the commandline enable the "test.integration.nms" flag, e.g.:
nant test -f:spring.build -D:test.integration.nms=true
Commandline Examples:
=====================
*) to build the distribution package, copy the key file into $/Spring.Net.snk and execute
nant clean package -f:spring.build -D:project.build.sign=true -D:package.version=1.3.0
*) to build a specific target platform
nant compile-build-3.5
*) to build just debug builds for all available platforms and execute tests
nant test
-->
<!--
global DIAGNOSTICS setting, applied to EVERY instance of <copy> task via verbose="${copy-verbose}" attribute
so as to be toggled in ONE place and affect ALL copy operations; leave FALSE except for debugging/troubleshooting the build
-->
<property name="copy-verbose" value="true" />
<!-- global project settings -->
<property name="project.name" value="Spring.NET"/>
<property name="project.name.full" value="Spring.NET Framework"/>
<property name="spring.basedir" value="${project::get-base-directory()}"/>
<property name="nuget.packages.dir" value="${environment::get-variable('HOMEPATH') + '\.nuget\packages'}"/>
<property name="spring.nonredistdir" value="${spring.basedir}\..\..\nonredist"/>
<property name="tool.dir" value="${project::get-base-directory()}\build-support\tools"/>
<property name="nuget.exe" value="${tool.dir}\NuGet\NuGet.exe"/>
<!--Support for Windows XP in other languages. In Portuguese, for example, is "c:\Arquivos de Programs"-->
<property name="programfiles" value="C:\Program Files"/>
<property name="programfilesx86" value="C:\Program Files (x86)"/>
<property name="programfiles" value="${environment::get-variable('ProgramFiles')}" failonerror="false"/>
<property name="programfilesx86" value="${environment::get-variable('ProgramFiles(x86)')}" failonerror="false"/>
<!-- build SDK docs with NDoc -->
<property name="doc.sdk" value="false"/>
<!-- turn on all tests if test.full specified -->
<property name="test.full" value="false" overwrite="false" />
<property name="test.integration.data" value="${test.full}" overwrite="false" />
<property name="test.integration.ems" value="${test.full}" overwrite="false" />
<property name="test.integration.nms" value="${test.full}" overwrite="false" />
<!--
the line below is for the ccnet build box - see target set-user-overrides for how to change this to your machine values if necessary
- or better check the registry key as shown above
-->
<!-- property name="vs-net.mstest.bin.dir" value="K:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" if="${not property::exists('vs-net.mstest.bin.dir')}" / -->
<!-- debug or release -->
<property name="project.build.config" value="debug"/>
<property name="project.build.package" value="false"/>
<property name="project.build.sign" value="false" overwrite="false" />
<property name="test.withcoverage" value="true" overwrite="false" />
<!-- what coverage tool to use: ncover or opencover -->
<property name="test.coverage.tool" value="opencover" overwrite="false" />
<!-- import non-redistributables if available -->
<!-- to build certain libraries (e.g. Spring.Messaging.Ems), 3rd party libraries are required
that we are not allowed to redistribute -->
<if test="${directory::exists(spring.nonredistdir)}">
<echo message="Copying non-redistributables into source tree"/>
<copy todir="${spring.basedir}" verbose="${copy-verbose}">
<fileset basedir="${spring.nonredistdir}">
<include name="**/*.*"/>
</fileset>
</copy>
</if>
<!-- Include spring helpers -->
<include buildfile="${spring.basedir}/Spring.include"/>
<include buildfile="${spring.basedir}/common-project.include"/>
<property name="package.version" value="0.0.0" overwrite="false"/>
<!-- change this to sync the sdk doc version generated -->
<property name="package.version.docs" value="${package.version}" />
<!-- make system environment variables available as NAnt properties -->
<property name="package.buildincrement" value="000" overwrite="false"/>
<call target="check-package.passedbuildincrement" />
<sysinfo failonerror="false" />
<property name="project.company" value="SpringSource"/>
<property name="project.copyright" value="Copyright 2002-2018 Spring.NET Framework Team."/>
<property name="key.file" value="Spring.Net.snk"/>
<property name="project.year" value="2018"/>
<!-- Targets that are always executed -->
<call target="set-build-configuration"/>
<!-- What packages to build -->
<property name="build.allnamespaces" value="false"/>
<if test="${not build.allnamespaces}">
<call target="set-build-namespaces-release"/>
</if>
<if test="${build.allnamespaces}">
<call target="set-build-namespaces-all"/>
</if>
<!-- no matter what, we can only use the last 3 digits of the passed-in build-increment value so ensure this is the case -->
<target name="check-package.passedbuildincrement">
<if test="${property::exists('package.passedbuildincrement') and string::get-length(package.passedbuildincrement) > 3}">
<property name="package.buildincrement" value="${string::substring(package.passedbuildincrement, string::get-length(package.passedbuildincrement) -3, 3)}" overwrite="true" />
</if>
</target>
<!-- call target="set-framework-configuration"/ -->
<call target="set-user-overrides"/>
<!-- Targets that check settings -->
<target name="check-package-version">
<fail message="A package version has not been specified." if="${not property::exists('package.version')}"/>
</target>
<target name="check-package-dir">
<property name="package.dir" value="build\package" overwrite="false"/>
<mkdir dir="${package.dir}"/>
</target>
<target name="check-current-package-dir">
<fail message="The current package directory has not been specified."
if="${not property::exists('current.package.dir')}"/>
<mkdir dir="${current.package.dir}"/>
</target>
<target name="check-htmlhelp-compiler">
<if test="${not property::exists('htmlhelp.compiler')}">
<readregistry property="htmlhelp.workshop.installroot"
key="SOFTWARE\Microsoft\HTML Help Workshop\InstallDir" hive="CurrentUser"
failonerror="false"/>
<if test="${property::exists('htmlhelp.workshop.installroot')}">
<property name="htmlhelp.compiler" value="${htmlhelp.workshop.installroot}/hhc.exe"/>
</if>
</if>
<if test="${not property::exists('htmlhelp.compiler')}">
<sysinfo/>
<property name="htmlhelp.compiler" value="${sys.os.folder.programfiles}/HTML Help Worshop/hhc.exe"/>
</if>
</target>
<!-- Target for cleaning up the current package directory -->
<target name="clean-current-package-dir" depends="check-current-package-dir"
description="Cleans the current package directory">
<echo message="Cleaning the ${current.package.dir} package directory."/>
<delete dir="${current.package.dir}" if="${directory::exists(current.package.dir)}"/>
<mkdir dir="${current.package.dir}"/>
</target>
<!-- Displays configuration info, usefull for working out why Spring.NET doesn't build -->
<target name="display-setup" depends="check-htmlhelp-compiler">
<!-- Mono 2.0 -->
<if test="${framework::exists('mono-2.0')}">
<property name="nant.settings.currentframework" value="mono-2.0"/>
<call target="display-target-framework"/>
</if>
<if test="${not framework::exists('mono-2.0')}">
<echo message="Mono 2.0 runtime is not available."/>
</if>
<!-- SSCLI 1.0 -->
<if test="${framework::exists('sscli-1.0')}">
<property name="nant.settings.currentframework" value="sscli-1.0"/>
<call target="display-target-framework"/>
</if>
<if test="${not framework::exists('sscli-1.0')}">
<echo message="SSCLI 1.0 runtime is not available."/>
</if>
<!-- HTML Help Compiler -->
<echo message="htmlhelp.compiler: ${htmlhelp.compiler}"/>
</target>
<target name="display-target-framework">
<echo message=""/>
<echo message="----------------------------------------------------------"/>
<echo message=" ${nant.settings.currentframework.description}"/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<echo message="framework : ${framework::get-target-framework()}"/>
<echo message="description : ${framework::get-description(framework::get-target-framework())}"/>
<if test="${framework::sdk-exists(framework::get-target-framework())}">
<echo message="sdk directory : ${framework::get-sdk-directory(framework::get-target-framework())}"/>
</if>
<if test="${not framework::sdk-exists(framework::get-target-framework())}">
<echo message="sdk directory : <not configured/available>"/>
</if>
<echo message="framework directory : ${framework::get-framework-directory(framework::get-target-framework())}"/>
<echo message="assembly directory : ${framework::get-assembly-directory(framework::get-target-framework())}"/>
<echo message=""/>
</target>
<!-- Target for setting the package configuration -->
<target name="set-package-configuration" depends="check-package-dir, check-package-version">
<property name="current.package.dir" value="${package.dir}/${project::get-name()}"/>
<!-- for docs packaging MLP -->
<!--
<property name="current.package.dir" value="l:/release/${project::get-name()}"/>
-->
<property name="doc.dir" value="${current.package.dir}/doc"/>
<property name="sdkdoc.dir" value="${doc.dir}/sdk"/>
</target>
<!-- Target for compiling all build configurations for all runtime configurations -->
<!-- <target name="compile-build-all" description="Compile all build configurations for all runtime configurations">
<echo message="Compiling all build configurations for all runtime configurations."/>
<call target="set-debug-build-configuration"/>
<call target="compile-build"/>
-->
<!-- make the release build, which requires Spring.Net.snk, only if making an distributable release -->
<!--<if test="${property::exists('project.build.package') and project.build.package}">
<call target="set-release-build-configuration"/>
<call target="compile-build"/>
</if>
</target>
-->
<!-- Target for compiling all runtime configurations in the current build configuration -->
<!--
<target name="compile-build" description="Compile current build configurations for all runtime configurations">
<echo message="Compiling all framework versions for the ${current.build.config} build configuration."/>
<call target="compile-build-3.5"/>
<call target="compile-build-4.0"/>
<call target="compile-build-4.5"/>
<call target="compile-build-mono-2.0"/>
</target>
-->
<target name="restore-nuget-packages" description="Restores NuGet packages that solution(s) reference">
<exec
program="${nuget.exe}"
commandline="restore .nuget/packages.config -SolutionDirectory ${spring.basedir}"
workingdir="${spring.basedir}"
failonerror="true" />
<foreach item="File" property="filename">
<in>
<items basedir="${spring.basedir}">
<include name="*.sln" />
<include name="examples/**/*.sln" />
<exclude name="examples/**/Spring.EmsQuickStart/*" />
<exclude name="examples/**/Spring.Examples.Pool/*" />
<exclude name="examples/**/SpringAir/*" />
</items>
</in>
<do>
<property name="solutionfile" value="${filename}" />
<exec program="${msbuild.exe}" verbose="true">
<arg value="${solutionfile}"/>
<arg line="/v:m" />
<arg line="/m" />
<arg line="/nr:false" />
<arg line="/t:Restore"/>
</exec>
</do>
</foreach>
</target>
<target name="compile-build-4.5" description="Builds for .NET 4.5 if available">
<call target="compile-net-4.5"/>
</target>
<target name="compile" description="Builds the current build configuration for the current target framework."
depends="check-current-build-config">
<call target="compile-net-4.5"/>
</target>
<target name="compile-test"> <!-- used as configurable template by all compile-{net|mono|netcf}-x.x targets -->
<property name="lib.dir" value="${spring.basedir}/lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<foreach item="Folder" property="path">
<in>
<items>
<include name="${spring.basedir}/build/${current.build.config}/*Tests" />
<exclude name="${spring.basedir}/build/${current.build.config}/Spring.Messaging.Ems.Integration.Tests" unless="${test.integration.ems}" />
<exclude name="${spring.basedir}/build/${current.build.config}/Spring.Messaging.Nms.Integration.Tests" unless="${test.integration.nms}" />
<exclude name="${spring.basedir}/build/${current.build.config}/Spring.Services.Tests" /> <!-- TODO should fix -->
<exclude name="${spring.basedir}/build/${current.build.config}/Spring.Testing.Microsoft.Tests" /> <!-- TODO use dotnet test -->
<exclude name="${spring.basedir}/build/${current.build.config}/Spring.Web.Conversation.NHibernate5.Tests" /> <!-- TODO check SQLite -->
</items>
</in>
<do>
<echo message="Running .NET Framework tests for ${path}" />
<property name="test.bin.dir" value="${path}/net461" />
<if test="${directory::exists(test.bin.dir) == false}">
<property name="test.bin.dir" value="${path}/net461" />
</if>
<property name="test.assemblyname" value="${string::substring(path, string::last-index-of(path, '\') + 1, string::get-length(path) - string::last-index-of(path, '\') - 1)}" />
<property name="test.assemblyfile" value="${test.assemblyname}.dll" />
<property name="test.assemblyname.tocover" value="${string::substring(test.assemblyname,0,string::last-index-of(test.assemblyname, '.Tests') )}" />
<call target="common.run-tests" />
</do>
</foreach>
<!-- run .NET Core separately for now -->
<call target="compile-test-netcore" />
<!-- build coverage summary -->
<exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false" if="${test.coverage.tool == 'ncover' and test.withcoverage}">
<arg value="/xml:"${current.bin.dir}/TestCoverageSummary.xml"" />
<arg value="/report:ModuleClassFunctionSummary" />
<arg value="/sort:4" />
<arg value="/minCoverage:80" />
<arg value="/q" />
<arg path="${current.bin.dir}/*-TestCoverage.xml" />
</exec>
<exec program="${tool.dir}\ReportGenerator\bin\ReportGenerator.exe" workingdir="${current.bin.dir}" verbose="true" if="${test.coverage.tool == 'opencover' and test.withcoverage}">
<arg value="*-TestCoverage.xml" />
<arg path="${current.bin.dir}\CoverageReport\Summary" />
</exec>
</target>
<target name="compile-test-netcore">
<foreach item="File" property="file">
<in>
<items>
<include name="${spring.basedir}/test/Spring/Spring.Core.Tests/Spring.Core.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Data.Tests/Spring.Data.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Integration.Tests/Spring.Data.NHibernate5.Integration.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Tests/Spring.Data.NHibernate5.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Scheduling.Quartz3.Tests/Spring.Scheduling.Quartz3.Tests.csproj" />
</items>
</in>
<do>
<echo message="Running .NET Core tests for ${file}" />
<exec program="dotnet" verbose="true">
<arg line="test" />
<arg line="/nodeReuse:false" />
<arg line="-c ${current.build.config}" />
<arg line="-f net5.0" />
<arg line="${file}" />
</exec>
</do>
</foreach>
</target>
<target name="compile-net-4.5" description="Builds .NET Framework 4.5 version"
depends="set-net-4.5-runtime-configuration, check-spring-basedir, restore-nuget-packages">
<property name="test.withcoverage" value="false" overwrite="true"/>
<if test="${property::exists('mstest.exe')}">
<property name="mstest.exe.current" value="${property::get-value('mstest.exe')}" />
<!-- <property name="mstest.exe.current" value="${string::replace(property::get-value('mstest.exe'), 'Microsoft Visual Studio 10.0', 'Microsoft Visual Studio 9.0')}" /> -->
</if>
<if test="${property::exists('mstest.exe')}">
<property name="vs-net.mstest.bin.dir.current" value="${property::get-value('vs-net.mstest.bin.dir')}" />
<!-- <property name="vs-net.mstest.bin.dir.current" value="${string::replace(property::get-value('vs-net.mstest.bin.dir'), 'Microsoft Visual Studio 10.0', 'Microsoft Visual Studio 9.0')}" /> -->
</if>
<call target="copykeys" if="${project.build.sign}"/>
<call target="common.generate-assemblyinfo"/>
<property name="build-ems" value="false" overwrite="true" />
<property name="build-nms" value="true" overwrite="true" />
<property name="build-quartz" value="true" overwrite="true" />
<property name="build-msmq" value="true" overwrite="true" />
<property name="build-msmq-tests" value="true" overwrite="true" />
<property name="build-velocity" value="true" overwrite="true" />
<property name="lib.dir" value="${spring.basedir}/lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<if test="${nant.settings.currentframework == 'net-4.5'}">
<property name="lib.dir" value="${spring.basedir}/lib/net/4.0"/>
</if>
<exec program="${msbuild.exe}" verbose="true">
<arg value="Spring.NET.sln"/>
<arg line="/nologo" />
<arg line="/v:m" />
<arg line="/m" />
<arg line="/nr:false" />
<arg line="/property:Configuration=${current.build.config}"/>
<!--Specifying mandatory property in SDK 7-->
<arg line='/property:Platform="Any CPU"'/>
</exec>
<call target="copylibs" />
<call target="compile-test" />
</target>
<target name="compile-mono-2.0" description="Builds MONO Framework 2.0 version"
depends="set-mono-2.0-runtime-configuration, check-spring-basedir">
<call target="copykeys" if="${project.build.sign}"/>
<call target="common.generate-assemblyinfo"/>
<property name="build-ems" value="false" overwrite="true" />
<property name="build-msmq" value="false" overwrite="true" />
<property name="build-msmq-tests" value="false" overwrite="true" />
<call target="compile-test" />
</target>
<target name="copykeys">
<if test="${not file::exists(spring.basedir + '/Spring.Net.snk')}">
<echo message="Key file not found. You can generate a key file by running 'sn -k Spring.Net.snk'."/>
<echo message="The generated key file should be stored in the Spring.Net base directory."/>
</if>
<if test="${file::exists(spring.basedir + '/Spring.Net.snk')}">
<!-- copy the Spring key file to the location where the compiler expects it to be -->
<copy file="Spring.Net.snk" todir="${current.bin.dir}"/>
</if>
<!-- for .NET 2.0 need to provide keyfile argument to compiler -->
<if test="${net-2.0}" if="${project.build.sign}">
<property name="compiler.args" value="/keyfile:..\..\..\Spring.Net.snk"/>
</if>
</target>
<target name="copylibtobin">
<echo message="Current bin dir = ${current.bin.dir}"/>
<echo message="Current lib dir = ${lib.dir}"/>
<!-- copy framework-neutral libraries -->
<copy todir="${current.bin.dir}" verbose="${copy-verbose}">
<fileset basedir="lib">
<include name="*.dll"/>
<include name="*.xml"/>
</fileset>
</copy>
<!-- copy framework-specific libraries -->
<copy todir="${current.bin.dir}" verbose="${copy-verbose}">
<fileset basedir="${lib.dir}">
<include name="*.dll"/>
<include name="*.xml"/>
<exclude name="nunit.core.*" />
</fileset>
</copy>
<!-- copy nuget libs -->
<copy todir="${current.bin.dir}" verbose="${copy-verbose}">
<fileset basedir="${nunit.lib.dir}">
<include name="*.dll"/>
<include name="*.xml"/>
</fileset>
</copy>
</target>
<target name="copylibs">
<property name="lib20.dir" value="${spring.basedir}\lib\${framework::get-family(framework::get-target-framework())}\2.0"/>
<echo message="Current lib20 dir = ${lib20.dir}"/>
<echo message="Current lib dir = ${lib.dir}"/>
<mkdir dir="${lib.dir}" failonerror="false" />
<copy todir="${lib.dir}" verbose="${copy-verbose}">
<fileset basedir="${lib20.dir}">
<include name="*.dll"/>
<exclude if="${net-3.5}" name="**/System.Web.Extensions.dll"/>
<exclude if="${net-4.0}" name="**/System.Web.Extensions.dll"/>
<exclude if="${net-4.5}" name="**/System.Web.Extensions.dll"/>
<include name="*.xml"/>
</fileset>
</copy>
</target>
<!-- Top level targets -->
<!-- target for developers to do just debug build and test everything in CVS -->
<target name="test" description="build and test">
<echo message="Compiling debug configuration for all runtime configurations."/>
<property name="nant.target.root.name" value="build"/>
<call target="build-all-function"/>
</target>
<target name="build-4.5">
<call target="set-build-namespaces-release"/>
<echo message="------------------------"/>
<echo message="Building .NET 4.5 DEBUG "/>
<echo message="------------------------"/>
<call target="set-debug-build-configuration"/>
<call target="compile-build-4.5"/>
<if test="${property::exists('project.build.package') and project.build.package}">
<echo message="--------------------------"/>
<echo message="Building .NET 4.5 RELEASE "/>
<echo message="--------------------------"/>
<call target="set-release-build-configuration"/>
<call target="compile-build-4.5"/>
</if>
</target>
<target name="build-mono-2.0" if="false">
<if test="${property::exists('project.build.package') and project.build.package}">
<call target="set-release-build-configuration"/>
<echo message="--------------------------"/>
<echo message="Building MONO 2.0 RELEASE "/>
<echo message="--------------------------"/>
<call target="compile-build-mono-2.0"/>
</if>
<echo message="--------------------------"/>
<echo message="Building MONO 2.0 DEBUG "/>
<echo message="--------------------------"/>
<call target="set-debug-build-configuration"/>
<call target="compile-build-mono-2.0"/>
</target>
<target name="clean" description="Deletes current build configuration">
<call target="cleanall"/>
</target>
<target name="cleanall" description="Deletes every build configuration">
<property name="target.dir" value="${path::combine(project::get-base-directory(),'build')}"/>
<echo message="Deleting all builds from all configurations : '${target.dir}'"/>
<delete
dir="${project::get-base-directory()}/build/net"
if="${directory::exists(target.dir)}"
failonerror="false"/>
</target>
<target name="clean-obj" description="Clean all 'obj' and 'bin' folders">
<delete>
<fileset basedir="src/">
<include name="**/bin/**/*.*" />
<include name="**/obj/**/*.*" />
</fileset>
</delete>
<delete>
<fileset basedir="test/">
<include name="**/bin/**/*.*" />
<include name="**/obj/**/*.*" />
</fileset>
</delete>
<delete>
<fileset basedir="examples/">
<include name="**/bin/**/*.*" />
<include name="**/obj/**/*.*" />
</fileset>
</delete>
</target>
<target name="package" depends="set-package-configuration" description="Build and Package distribution">
<property name="project.build.sign" value="true" overwrite="false" />
<property name="project.build.package" value="true"/>
<call target="clean-current-package-dir"/>
<property name="nant.target.root.name" value="build"/>
<call target="set-build-namespaces-release"/>
<property name="project.build.sign" value="true" overwrite="false" />
<property name="project.build.package" value="true"/>
<call target="build-all-function"/>
<call target="doc"/>
<call target="package-release-files"/>
<call target="package-nuget" />
</target>
<target name="doc">
<call target="doc-reference" cascade="false" />
<call target="doc-sdk" cascade="false" if="${doc.sdk}"/>
</target>
<target name="doc-reference">
<nant buildfile="./doc/reference/docbook.build" />
</target>
<target name="doc-sdk">
<echo message="Creating SDK Documentation for Spring.NET" />
<!-- clean tmp dir -->
<delete dir="./doc/sdk/target" failonerror="false" />
<exec workingdir="." program="./build-support/tools/ndoc3/NDoc3Console.exe">
<arg value="-project=./doc/sdk/Spring.NET-net-2.0.ndoc" />
</exec>
<!-- copy sdk docs to final destination -->
<move todir="./doc/sdk/target/htmlhelp" overwrite="true">
<fileset basedir="./doc/sdk/target/tmp/">
<include name="*.chm"/>
</fileset>
</move>
<move todir="./doc/sdk/target/html" overwrite="true">
<fileset basedir="./doc/sdk/target/tmp/">
<include name="**/*"/>
<exclude name="*.chw" />
<exclude name="*.hhc" />
<exclude name="*.hhk" />
<exclude name="*.hhp" />
<exclude name="*.chm" />
<exclude name="ndoc3_msdn_temp" />
</fileset>
</move>
<!-- clean tmp dir -->
<delete dir="./doc/sdk/target/tmp" failonerror="false" />
</target>
<target name="package-release">
<call target="set-release-build-configuration"/>
<call target="package-release-files"/>
</target>
<!--
Target to use when packaging as a standalone .zip file. VS.NET docs
included but compressed sdk-web directory is. Intended for mono developers
-->
<target name="package-zip" description="Build and Package distribution as .zip file">
<call target="package"/>
<property name="project.zip-path" value="${package.dir}/${project.name}-${package.version}.zip"/>
<zip zipfile="${project.zip-path}">
<fileset basedir="${package.dir}/${project.name}-${package.version}">
<include name="**/*"/>
<exclude name="**/sdk-web/**"/>
</fileset>
</zip>
</target>
<target name="dailysnapshot">
<property name="nant.target.root.name" value="daily-build"/>
<property name="project.build.sign" value="true"/>
<!-- call target="copykeys"/ -->
<!-- build all binaries -->
<call target="build-all-function"/>
<call target="package-cvs"/>
<call target="upload-cvs-release"/>
</target>
<target name="build-all-function" description="Build what is in cvs taking into account approrpiate clr versions and root target name">
<call target="${nant.target.root.name}-4.5" />
<call target="build-solutions" />
</target>
<target name="daily-build-4.5">
<call target="set-build-namespaces-all"/>
<call target="set-package-configuration"/>
<call target="set-debug-build-configuration"/>
<call target="compile-build-4.5"/>
<call target="set-release-build-configuration"/>
<call target="compile-build-4.5"/>
</target>
<!-- Target to use when packaging everything in CVS -->
<target name="package-cvs" description="Build and Package distribution">
<property name="project.build.package" value="false"/>
<tstamp/>
<property name="package.version" value="${tstamp.date}-${tstamp.time}"/>
<!-- nant buildfile="./doc/reference/docbook.build" target="all"/ -->
<call target="doc" />
<call target="set-debug-build-configuration"/>
<call target="package-release-files"/>
<property name="project.zip-path" value="${package.dir}/${project.name}-${package.version}.zip"/>
<!-- for some reason this isn't being properly excluded in src.to.copy -->
<delete>
<fileset basedir="${current.package.dir}">
<include name="**/${project.name}-SDK-HTML.zip"/>
</fileset>
</delete>
<zip zipfile="${project.zip-path}">
<fileset basedir="${current.package.dir}">
<include name="**/*"/>
<exclude name="**/sdk-web/**"/>
</fileset>
</zip>
</target>
<target name="package-tools">
<!-- copy third-party tools -->
<mkdir dir="${current.package.dir}/build-support/tools"/>
<copy todir="${current.package.dir}/build-support/tools" verbose="${copy-verbose}">
<fileset basedir="build-support/tools">
<include name="antlr-2.7.6/**/*"/>
<include name="nunit/**/*"/>
<include name="ncover/**/*"/>
<include name="ncoverexplorer/**/*"/>
<include name="ndoc3/**/*"/>
</fileset>
</copy>
</target>
<target name="test-zip">
<property name="project.build.package" value="false"/>
<tstamp/>
<property name="package.version" value="${tstamp.date}-${tstamp.time}"/>
<call target="set-build-namespaces-all"/>
<call target="set-package-configuration"/>
<call target="set-debug-build-configuration"/>
<property name="project.zip-path" value="${package.dir}/${project.name}-${package.version}.zip"/>
<echo message="project.zip-path = ${project.zip-path}"/>
<delete>
<fileset basedir="${current.package.dir}">
<include name="**/${project.name}-SDK-HTML.zip"/>
</fileset>
</delete>
<zip zipfile="${project.zip-path}">
<fileset basedir="${current.package.dir}">
<include name="**/*"/>
<exclude name="**/sdk-web/**"/>
</fileset>
</zip>
</target>
<target name="upload-cvs-release">
<call target="set-package-configuration"/>
<property name="filetoupload" value="${project.name}-${package.version}.zip"/>
<property name="spring.ssh.server" value="s2-prod-wwworg-p1.vmware.com" />
<property name="spring.web.path" value="/var/www/domains/springframework.net/www/htdocs" />
<!-- setup property that holds partial path to be used by scp -->
<property name="serverpart" value="${spring.ssh.server + ':' + spring.web.path}" />
<property name="nightly.builds.path" value="downloads/nightly"/>
<echo message="uploading ${filetoupload} to AmazonS3..."/>
<exec workingdir="${spring.basedir}" program="cmd.exe" verbose="true">
<arg value="/c powershell-invoker .\s3-nightly-upload.ps1 -srcFolderPath ${package.dir} -srcFilename ${filetoupload}" />
</exec>
<echo message="Deleting outdated files on AmazonS3..."/>
<exec workingdir="${spring.basedir}" program="cmd.exe" verbose="true">
<arg value="/c powershell-invoker .\s3-nightly-delete-old-files.ps1 -leaveLatest 10" />
</exec>
</target>
<target name="package-release-files" depends="set-package-configuration">
<echo message="Current package directory = ${current.package.dir}"/>
<copy todir="${current.package.dir}" verbose="${copy-verbose}">
<fileset>
<include name="${solution.file.2010}"/>
<include name="readme.txt"/>
<include name="changelog.txt"/>
<include name="license.txt"/>
<include name="Spring.build"/>
<include name="Spring.include"/>
<include name="common-project.include"/>
<include name="BreakingChanges.txt"/>
<!-- exclude VS.Net stuff -->
<exclude name="**/sdk-web/**"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.user"/>
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/*.resharper"/>
<exclude name="**/*.resharper.user"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
<!-- copy spring binaries -->
<call target="package-release-files-spring.binaries" />
<!-- copy user reference documentation -->
<mkdir dir="${current.package.dir}/doc/reference"/>
<copy todir="${current.package.dir}/doc/reference" verbose="${copy-verbose}">
<fileset basedir="doc/reference/target">
<include name="html/**/*"/>
<include name="pdf/**/*"/>
<include name="htmlhelp/**/*"/>
<exclude name="**/*.ppt*" />
</fileset>
</copy>
<!-- copy third-party libraries -->
<mkdir dir="${current.package.dir}/lib/Net"/>
<if test="${property::exists('build.allnamespaces') and not build.allnamespaces}">
<copy todir="${current.package.dir}/lib/Net" verbose="${copy-verbose}">
<fileset basedir="lib/Net">
<include name="**/DotNetMock*.dll"/>
<include name="**/log4net.dll"/>
<include name="**/Common.Logging.dll"/>
<include name="**/Common.Logging.Core.dll"/>
<include name="**/antlr.runtime.dll"/>
<include name="**/nunit.*.dll"/>
<include name="**/nunit.*.xml"/>
<include name="**/NUnitAsp.dll"/>
<include name="**/NUnitAspEx.dll"/>
<include if="${not net-4.0}" name="**/System.Web.Extensions.dll"/>
<include name="**/Apache.NMS.dll"/>
<include name="**/Apache.NMS.pdb"/>
<include name="**/Apache.NMS.ActiveMQ.dll"/>
<include name="**/Apache.NMS.ActiveMQ.pdb"/>
<include name="**/EULA.rtf"/>
<exclude name="**/TIBCO.EMS.ADMIN.dll"/>
<exclude name="**/TIBCO.EMS.dll"/>
</fileset>
</copy>
</if>
<if test="${property::exists('build.allnamespaces') and build.allnamespaces}">
<copy todir="${current.package.dir}/lib" verbose="${copy-verbose}">
<fileset basedir="lib">
<include name="**/*.dll"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</if>
<!-- copy additional scripts -->
<mkdir dir="${current.package.dir}/build-support"/>
<copy todir="${current.package.dir}/build-support" verbose="${copy-verbose}">
<fileset basedir="build-support">
<include name="solutions.build.nant"/>
</fileset>
</copy>
<!-- copy third-party icons -->
<mkdir dir="${current.package.dir}/build-support/icons"/>
<copy todir="${current.package.dir}/build-support/icons" verbose="${copy-verbose}">
<fileset basedir="build-support/icons">
<include name="*.ico"/>
<include name="*.pal"/>
</fileset>
</copy>
<!-- copy additional convenience solution files -->
<mkdir dir="${current.package.dir}/build-support/solutions"/>
<copy todir="${current.package.dir}/build-support/solutions" verbose="${copy-verbose}">
<fileset basedir="build-support/solutions">
<include name="*.sln"/>
</fileset>
</copy>
<call target="package-tools"/>
<!-- copy schema and dtd -->
<mkdir dir="${current.package.dir}/doc/schema"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Core/Objects/Factory/Xml/spring-objects-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Core/Objects/Factory/Xml/spring-tool-1.1.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Core/Validation/Config/spring-validation-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Aop/Aop/Config/spring-aop-1.1.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Data/Data/Config/spring-database-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Data/Transaction/Config/spring-tx-1.1.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Services/Remoting/Config/spring-remoting-1.1.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Services/ServiceModel/Config/spring-wcf-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Messaging.Nms/Messaging/Nms/Config/spring-nms-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Messaging.Ems/Messaging/Ems/Config/spring-ems-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="src/Spring/Spring.Template.Velocity/Template/Velocity/Config/spring-nvelocity-1.3.xsd"/>
<copy todir="${current.package.dir}/doc/schema"
file="build-support/install-schema.build"/>
<mkdir dir="${current.package.dir}/bin/net/3.5/debug"/>
<mkdir dir="${current.package.dir}/bin/net/3.5/release"/>
<copy todir="${current.package.dir}/bin/net/3.5/debug"
file="build-support/readme-net-3.5.txt"/>
<copy todir="${current.package.dir}/bin/net/3.5/release"
file="build-support/readme-net-3.5.txt"/>
<echo message="copying source code for release..."/>
<!-- copy source code -->
<copy todir="${current.package.dir}" verbose="${copy-verbose}">
<fileset refid="src.to.copy"/>
</copy>
<!-- copy examples -->
<copy todir="${current.package.dir}/examples" verbose="${copy-verbose}">
<fileset basedir="examples">
<include name="**/*.refresh"/>
<include name="**/*.refresh"/>
</fileset>
</copy>