File: log4net.build

package info (click to toggle)
log4net 1.2.10%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 16,716 kB
  • ctags: 3,590
  • sloc: cs: 25,174; xml: 8,133; cpp: 91; makefile: 57; ansic: 7
file content (845 lines) | stat: -rw-r--r-- 50,779 bytes parent folder | download | duplicates (5)
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
<?xml version="1.0" ?>
<!--
Copyright 2004-2005 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="log4net" default="compile-all" xmlnds="http://tempuri.org/nant-vs.xsd">
    <!-- Global project settings -->
    <property name="log4net.basedir" value="." />
    <property name="project.build.config" value="debug" />
    <property name="project.build.package" value="false" />
    <!-- Include log4net helpers -->
    <include buildfile="${log4net.basedir}/log4net.include" />
    <!-- Targets that should always be executed -->
    <call target="set-build-configuration" />
    <call target="set-framework-configuration" />
    <!-- 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-current-package-zipfile">
        <fail 
            message="The current package zipfile has not been specified."
            if="${not property::exists('current.package.zipfile')}" />
    </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 log4net doesn't build -->
    <target name="display-setup" depends="check-htmlhelp-compiler">
        <!-- .NET Framework 1.0 -->
        <if test="${framework::exists('net-1.0')}">
            <property name="nant.settings.currentframework" value="net-1.0" />
            <call target="display-target-framework" />
        </if>
        <if test="${not framework::exists('net-1.0')}">
            <echo message=".NET Framework 1.0 runtime is not available." />
        </if>
        <!-- .NET Framework 1.1 -->
        <if test="${framework::exists('net-1.1')}">
            <property name="nant.settings.currentframework" value="net-1.1" />
            <call target="display-target-framework" />
        </if>
        <if test="${not framework::exists('net-1.1')}">
            <echo message=".NET Framework 1.1 runtime is not available." />
        </if>
        <!-- .NET Framework 2.0 -->
        <if test="${framework::exists('net-2.0')}">
            <property name="nant.settings.currentframework" value="net-2.0" />
            <call target="display-target-framework" />
        </if>
        <if test="${not framework::exists('net-2.0')}">
            <echo message=".NET Framework 2.0 runtime is not available." />
        </if>
        <!-- .NET Compact Framework 1.0 -->
        <if test="${framework::exists('netcf-1.0')}">
            <property name="nant.settings.currentframework" value="netcf-1.0" />
            <call target="display-target-framework" />
        </if>
        <if test="${not framework::exists('netcf-1.0')}">
            <echo message=".NET Compact Framework 1.0 runtime is not available." />
        </if>
        <!-- Mono 1.0 -->
        <if test="${framework::exists('mono-1.0')}">
            <property name="nant.settings.currentframework" value="mono-1.0" />
            <call target="display-target-framework" />
        </if>
        <if test="${not framework::exists('mono-1.0')}">
            <echo message="Mono 1.0 runtime is not available." />
        </if>
        <!-- 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 : &lt;not configured/available&gt;" />
        </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.name" value="${nant.project.name}-${package.version}" />
        <property name="current.package.dir" value="${package.dir}/${current.package.name}" />
        <property name="log4net.basedir" value="${current.package.dir}" />
        <property name="current.package.zipfile" value="${project::get-name()}-${package.version}.zip" />
        <property name="bin.dir" value="${current.package.dir}/bin" />
        <property name="doc.dir" value="${current.package.dir}/doc" />
        <property name="sdkdoc.dir" value="${doc.dir}/sdk" />
        <delete dir="${current.package.dir}" if="${directory::exists(current.package.dir)}" />
        <mkdir dir="${current.package.dir}" />
    </target>
    <!-- Target for compiling all build configurations for all runtime configurations -->
    <target name="compile-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" />
        <call target="set-release-build-configuration" />
        <call target="compile-build" />
    </target>
    <!-- Target for compiling all build configurations for the current runtime configurations -->
    <target name="compile-runtime" description="Compile all build configurations for the current target framework">
        <echo message="Compiling all build configurations for ${framework::get-description(framework::get-target-framework())}." />
        <call target="set-debug-build-configuration" />
        <!-- make sure that the runtime properties that rely on build configuration information are refreshed -->
        <call target="set-runtime-configuration" />
        <call target="compile-${framework::get-target-framework()}" />
        <call target="set-release-build-configuration" />
        <!-- make sure that the runtime properties that rely on build configuration information are refreshed -->
        <call target="set-runtime-configuration" />
        <call target="compile-${framework::get-target-framework()}" />
    </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." />
        <if test="${framework::exists('netcf-1.0')}">
            <call target="compile-netcf-1.0" />
        </if>
        <if test="${not framework::exists('netcf-1.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="The .NET Compact Framework 1.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo 
                    message="The .NET Compact Framework 1.0 is not available. Build skipped." />
            </if>
        </if>
        <if test="${framework::exists('net-1.0')}">
            <call target="compile-net-1.0" />
            <call target="compile-cli-1.0" />
        </if>
        <if test="${not framework::exists('net-1.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="The .NET Framework 1.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="The .NET Framework 1.0 is not available. Build skipped." />
            </if>
        </if>
        <if test="${framework::exists('net-1.1')}">
            <call target="compile-net-1.1" />
        </if>
        <if test="${not framework::exists('net-1.1')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="The .NET Framework 1.1 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="The .NET Framework 1.1 is not available. Build skipped." />
            </if>
        </if>
        <if test="${framework::exists('net-2.0')}">
            <call target="compile-net-2.0" />
        </if>
        <if test="${not framework::exists('net-2.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="The .NET Framework 2.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="The .NET Framework 2.0 is not available. Build skipped." />
            </if>
        </if> 
        <if test="${framework::exists('mono-1.0')}">
            <call target="compile-mono-1.0" />
        </if>
        <if test="${not framework::exists('mono-1.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="Mono 1.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="Mono 1.0 is not available. Build skipped." />
            </if>
        </if>
        <if test="${framework::exists('mono-2.0')}">
            <call target="compile-mono-2.0" />
        </if>
        <if test="${not framework::exists('mono-2.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="Mono 2.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="Mono 2.0 is not available. Build skipped." />
            </if>
        </if>
        <if test="${framework::exists('sscli-1.0')}">
            <call target="compile-sscli-1.0" />
        </if>
        <if test="${not framework::exists('sscli-1.0')}">
            <if test="${property::exists('project.build.package') and project.build.package}">
                <fail message="SSCLI 1.0 is not available." />
            </if>
            <if test="${not(property::exists('project.build.package') and project.build.package)}">
                <echo message="SSCLI 1.0 is not available. Build skipped." />
            </if>
        </if>
    </target>
    <target name="compile" description="Builds the current build configuration for the current target framework." depends="check-current-build-config">
        <call target="compile-${framework::get-target-framework()}" />
    </target>
    <target name="compile-netcf-1.0" description="Builds .NET Compact Framework 1.0 version" depends="set-netcf-1.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
            <if test="${file::exists(log4net.basedir + '/log4net.snk')}">
                <!-- copy the log4net key file to the location where the compiler expects it to be -->
                <copy file="${log4net.basedir}/log4net.snk" todir="${current.bin.dir}/../../../" />
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <target name="compile-net-1.0" description="Builds .NET Framework 1.0 version" depends="set-net-1.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
            <if test="${file::exists(log4net.basedir + '/log4net.snk')}">
                <!-- copy the log4net key file to the location where the compiler expects it to be -->
                <copy file="${log4net.basedir}/log4net.snk" todir="${current.bin.dir}/../../../" />
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc nostdlib="true" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <target name="compile-net-1.1" description="Builds .NET Framework 1.1 version" depends="set-net-1.1-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
            <if test="${file::exists(log4net.basedir + '/log4net.snk')}">
                <!-- copy the log4net key file to the location where the compiler expects it to be -->
                <copy file="${log4net.basedir}/log4net.snk" todir="${current.bin.dir}/../../../" />
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc nostdlib="true" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <target name="compile-net-2.0" description="Builds .NET Framework 2.0 version" depends="set-net-2.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc keyfile="${path::combine(log4net.basedir, 'log4net.snk')}" nostdlib="true" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <nowarn>
                    <!-- warning CS1058: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a System.Runtime.CompilerServices.RuntimeWrappedException -->
                    <warning number="1058" />
                </nowarn>
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <include name="System.Configuration.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <target name="compile-mono-1.0" description="Builds Mono 1.0 version" depends="set-mono-1.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc keyfile="${path::combine(log4net.basedir, 'log4net.snk')}" nostdlib="false" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <nowarn>
                    <!-- workaround for Mono bug #61902 -->
                    <warning number="0618" />
                    <!-- warning CS1058: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a System.Runtime.CompilerServices.RuntimeWrappedException -->
                    <warning number="1058" />
                </nowarn>
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <target name="compile-mono-2.0" description="Builds Mono 2.0 version" depends="set-mono-2.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc keyfile="${path::combine(log4net.basedir, 'log4net.snk')}" nostdlib="false" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <nowarn>
                    <!-- workaround for Mono bug #61902 -->
                    <warning number="0618" />
                    <!-- warning CS1058: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a System.Runtime.CompilerServices.RuntimeWrappedException -->
                    <warning number="1058" />
                </nowarn>
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
  </target>
  <target name="compile-sscli-1.0" description="Builds SSCLI 1.0 version" depends="set-sscli-1.0-runtime-configuration, check-log4net-basedir, clean-current-bin-dir">
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
            <if test="${file::exists(log4net.basedir + '/log4net.snk')}">
                <!-- copy the log4net key file to the location where the compiler expects it to be -->
                <copy file="${log4net.basedir}/log4net.snk" todir="${current.bin.dir}/../../../" />
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc nostdlib="true" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll">
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <!--
        This version is built to run on any CLI 1.0 (ECMA 335) standard runtime.
        The build excludes any code that is platform specific.
        The .NET 1.0 compiler and library are used to build the assembly.
        
        The log4net CLI 1.0 assembly is runtime compatible with the following frameworks :
        * Microsoft .NET Framework 1.0 (and higher)
        * Mono 1.0 (and higher)
        
        We only provide this "flavor" of log4net in release configuration because
        debugging information is not standardized and would be too closely tied to
        a specific implementation.
    -->
    <target name="compile-cli-1.0" description="Builds CLI 1.0 version" depends="set-cli-1.0-configuration, check-log4net-basedir, clean-current-bin-dir" if="${current.build.config.release}">
        <delete>
            <fileset basedir="${current.bin.dir}">
                <include name="log4net.*" />
            </fileset>
        </delete>
        <!-- initialize the temp.build.skip property to false -->
        <property name="temp.build.skip" value="false" />
        <if test="${current.build.config.release}">
            <!-- check if the log4net key file is available -->
            <if test="${not file::exists(log4net.basedir + '/log4net.snk')}">
                <if test="${property::exists('project.build.package') and project.build.package}">
                    <fail message="Key file not found." />
                </if>
                <if test="${not(property::exists('project.build.package') and project.build.package)}">
                    <echo message="Key file not found. You can generate a key file by running 'sn -k log4net.snk'." />
                    <echo message="The generated key file should be stored in the log4net base directory." />
                    <echo message="The release build will be skipped." />
                    <property name="temp.build.skip" value="true" />
                </if>
            </if>
            <if test="${file::exists(log4net.basedir + '/log4net.snk')}">
                <!-- copy the log4net key file to the location where the compiler expects it to be -->
                <copy file="${log4net.basedir}/log4net.snk" todir="${current.bin.dir}/../../../" />
            </if>
        </if>
        <if test="${not temp.build.skip}">
            <csc nostdlib="true" noconfig="true" warnaserror="true" target="library" debug="${current.build.debug}" define="${current.build.defines.csc}" output="${current.bin.dir}/log4net.dll" doc="${current.bin.dir}/log4net.xml">
                <sources basedir="${log4net.basedir}/src">
                    <include name="**/*.cs" />
                </sources>
                <references>
                    <include name="mscorlib.dll" />
                    <include name="System.dll" />
                    <include name="System.Data.dll" />
                    <include name="System.Web.dll" />
                    <include name="System.Xml.dll" />
                    <!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework family>/<framework version>/<build configuration> directory -->
                    <include name="lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/*.dll" />
                </references>
            </csc>
        </if>
    </target>
    <!-- Target for generating docs for all runtime configurations -->
    <target name="generate-sdkdoc-all" depends="check-current-build-config">
        <echo message="Generating SDK documentation temporarily disabled." />
        <!--
        <echo message="Generating SDK documentation based on the ${current.build.config} build configuration for all runtime configurations." />
        <if test="${framework::exists('netcf-1.0')}">
            <call target="set-netcf-1.0-runtime-configuration" />
            <call target="generate-sdkdoc" />
        </if>
        <if test="${framework::exists('net-1.0')}">
            <call target="set-net-1.0-runtime-configuration" />
            <call target="generate-sdkdoc" />
        </if>
        <if test="${framework::exists('net-1.1')}">
            <call target="set-net-1.1-runtime-configuration" />
            <call target="generate-sdkdoc" />
        </if>
        -->
        <!-- NAnt doesn't yet come with a version of NDoc that can handle .NET 2.0 assemblies -->
        <!-- Mono 1.0 does not support extracting xml documentation -->
        <!-- SSCLI 1.0 does not support extracting xml documentation -->
    </target>
    <!-- Target for generating docs for build configurations -->
    <target name="generate-sdkdoc" depends="compile, check-htmlhelp-compiler, check-current-sdkdoc-dir, check-current-sdkdoc-debug, clean-current-sdkdoc-dir">
        <ndoc>
            <assemblies basedir="${current.bin.dir}">
                <include name="log4net.dll" />
            </assemblies>
            <documenters>
                <documenter name="MSDN">
                    <property name="OutputDirectory" value="${current.sdkdoc.dir}" />
                    <property name="HtmlHelpName" value="log4net-sdk-${framework::get-target-framework()}" />
                    <property name="HtmlHelpCompilerFilename" value="${htmlhelp.compiler}" />
                    <property name="IncludeFavorites" value="true" />
                    <property name="IncludeHierarchy" value="true" />
                    <property name="Title" value="log4net SDK Documentation - ${framework::get-description(framework::get-target-framework())}" />
                    <property name="SplitTOCs" value="false" />
                    <property name="DefaulTOC" value="" />
                    <property name="ShowVisualBasic" value="true" />
                    <property name="OmitObjectTags" value="false" />
                    <property name="RootPageContainsNamespaces" value="false" />
                    <property name="SortTOCByNamespace" value="true" />
                    <property name="ShowMissingSummaries" value="${current.sdkdoc.debug}" />
                    <property name="ShowMissingRemarks" value="${current.sdkdoc.debug}" />
                    <property name="ShowMissingParams" value="${current.sdkdoc.debug}" />
                    <property name="ShowMissingReturns" value="${current.sdkdoc.debug}" />
                    <property name="ShowMissingValues" value="${current.sdkdoc.debug}" />
                    <property name="DocumentAttributes" value="false" />
                    <property name="DocumentedAttributes" value="" />
                    <property name="DocumentInternals" value="false" />
                    <property name="DocumentPrivates" value="false" />
                    <property name="DocumentProtected" value="true" />
                    <property name="DocumentEmptyNamespaces" value="false" />
                    <property name="SkipNamespacesWithoutSummaries" value="false" />
                    <property name="AutoPropertyBackerSummaries" value="false" />
                    <property name="AutoDocumentConstructors" value="true" />
                    <property name="GetExternalSummaries" value="true" />
                    <property name="IncludeAssemblyVersion" value="false" />
                    <property name="CopyrightText" value="Copyright 2001-2006 The Apache Software Foundation." />
                    <property name="CopyrightHref" value="http://logging.apache.org/log4net" />
                </documenter>
            </documenters>
        </ndoc>
        <!-- Remove everything except the help file itself from the current SDK documentation directory -->
        <delete>
            <fileset basedir="${current.sdkdoc.dir}">
                <include name="**/*" />
                <exclude name="**/*.chm" />
            </fileset>
        </delete>
    </target>
    <target name="package" depends="set-package-configuration" description="Build and Package distribution">
        <!-- set flag to indicating that this is a package build -->
        <property name="project.build.package" value="true" />
        <!-- clean the current package directory -->
        <call target="clean-current-package-dir" />
        <!-- copies the examples to the current package directory -->
        <call target="package-examples" />
        <!-- copies the sources to the current package directory -->
        <call target="package-src" />
        <!-- copies the unit tests sources to the current package directory -->
        <call target="package-tests-src" />
        <!-- copies the extenstions to the current package directory -->
        <call target="package-extensions" />
        <!-- copies the documentation to the current package directory -->
        <call target="package-doc" />
        <!-- copies the release files to the current package directory -->
        <call target="package-release-files" />
        <!-- compile all build configurations for all runtime configurations  -->
        <call target="compile-all" />
        <!-- compile all examples -->
        <call target="compile-examples" />
        <!-- compile all extensions -->
        <call target="compile-extensions" />
        <!-- generate the sdk docs using the release build configuration for all runtime configuration -->
        <call target="set-release-build-configuration" />
        <call target="generate-sdkdoc-all" />
        <!-- create the package distribution zipfile -->
        <call target="create-package-zipfile" />
    </target>
    <target name="package-examples" depends="check-current-package-dir, check-log4net-basedir">
        <mkdir dir="${current.package.dir}/examples" />
        <delete dir="${current.package.dir}/examples" />
        <copy todir="${current.package.dir}/examples">
            <fileset basedir="examples">
                <include name="**/*" />
                <exclude name="**/bin/**" />
                <exclude name="**/build/**" />
                <exclude name="**/doc/**" />
                <exclude name="**/obj/**" />
                <exclude name="**/*.csproj.user" />
                <exclude name="**/*.csdproj.user" />
                <exclude name="**/*.vbproj.user" />
                <exclude name="**/*.vbdproj.user" />
                <exclude name="**/*.suo" />
                <exclude name="**/*.sln.old" />
                <!-- file created by mono compiler -->
                <exclude name="**/gc.log" />
            </fileset>
        </copy>
    </target>
    <target name="package-src" depends="check-current-package-dir, check-log4net-basedir">
        <mkdir dir="${current.package.dir}/src" />
        <delete dir="${current.package.dir}/src" />
        <copy todir="${current.package.dir}/src">
            <fileset basedir="src">
                <include name="**/*" />
                <exclude name="**/obj/**" />
                <exclude name="*.csproj.user" />
                <exclude name="*.suo" />
                <exclude name="log4net.ndoc" />
                <exclude name="log4net*.xml" />
                <exclude name="**/*.sln.old" />
            </fileset>
        </copy>
    </target>
    <target name="package-tests-src" depends="check-current-package-dir, check-log4net-basedir">
        <mkdir dir="${current.package.dir}/tests" />
        <delete dir="${current.package.dir}/tests" />
        <copy todir="${current.package.dir}/tests/src">
            <fileset basedir="tests/src">
                <include name="**/*" />
                <exclude name="**/bin/**" />
                <exclude name="**/obj/**" />
                <exclude name="*.csproj.user" />
                <exclude name="*.suo" />
                <exclude name="log4net.ndoc" />
                <exclude name="log4net*.xml" />
                <exclude name="**/*.sln.old" />
            </fileset>
        </copy>
        <copy todir="${current.package.dir}/tests/lib">
            <fileset basedir="tests/lib">
                <include name="**/*.dll" />
            </fileset>
        </copy>
        <copy todir="${current.package.dir}/tests">
            <fileset basedir="tests">
                <include name="**/nant.*" />
            </fileset>
        </copy>
    </target>
    <target name="package-extensions" depends="check-current-package-dir, check-log4net-basedir">
        <mkdir dir="${current.package.dir}/extensions" />
        <delete dir="${current.package.dir}/extensions" />
        <copy todir="${current.package.dir}/extensions">
            <fileset basedir="extensions">
                <include name="**/*" />
                <exclude name="**/bin/**" />
                <exclude name="**/build/**" />
                <exclude name="**/doc/**" />
                <exclude name="**/obj/**" />
                <exclude name="**/*.csproj.user" />
                <exclude name="**/*.vbproj.user" />
                <exclude name="**/*.suo" />
                <exclude name="**/*.sln.old" />
            </fileset>
        </copy>
    </target>
    <target name="package-doc" depends="check-current-package-dir, check-log4net-basedir">
        <mkdir dir="${current.package.dir}/doc" />
        <copy todir="${current.package.dir}/doc" includeemptydirs="false">
            <fileset basedir="doc">
                <include name="**/*" />
                <exclude name="**/ndoc.log" />
            </fileset>
        </copy>
        <mkdir dir="${current.package.dir}/xdocs" />
        <copy todir="${current.package.dir}/xdocs" includeemptydirs="false">
            <fileset basedir="xdocs">
                <include name="**/*.xml" />
                <include name="**/*.vsl" />
            </fileset>
        </copy>
    </target>
    <target name="package-release-files" depends="check-current-package-dir, check-log4net-basedir">
        <copy todir="${current.package.dir}">
            <fileset basedir=".">
                <!-- <include name="index.html" /> -->
                <include name="build.cmd" />
                <include name="ChangeLog.txt" />
                <include name="log4net.build" />
                <include name="log4net.include" />
                <!-- <include name="releasenotes.html" /> -->
                <include name="LICENSE.txt" />
                <include name="NOTICE.txt" />
                <include name="README.txt" />
                <include name="log4net.snk" />
                <include name="log4net.snk.readme" />
            </fileset>
        </copy>
    </target>
    <target name="create-package-zipfile" depends="check-current-package-dir, check-current-package-zipfile, check-log4net-basedir">
        <!-- delete the specified zipfile if it already exists -->
        <delete>
            <fileset basedir=".">
                <include name="${current.package.zipfile}" />
            </fileset>
        </delete>
        <zip zipfile="${current.package.zipfile}" ziplevel="9">
            <fileset basedir="${current.package.dir}" prefix="${current.package.name}">
                <include name="**/*" />
                <!-- do not include the log4net keyfiles -->
                <exclude name="**/*.snk" />
                <!-- do not include the built examples -->
                <exclude name="examples/**/bin/**" />
                <!-- do not include the docs of examples -->
                <exclude name="examples/**/doc/**" />
                <!-- do not include the built extensions -->
                <exclude name="extensions/**/bin/**" />
                <!-- do not include the docs of extensions -->
                <exclude name="extensions/**/doc/**" />
                <!-- file created by mono compiler -->
                <exclude name="**/gc.log" />
                <!-- do not include the nunit binaries -->
                <exclude name="tests/**/nunit*.dll" />
                <!-- do not include the Visual Studio .NET 2003 project and solution files -->
                <exclude name="**/*vs2003*" />
                <!-- do not include old swp files (there shouldn't be any!) -->
                <exclude name="**/*.swp" />
            </fileset>
        </zip>
    </target>
    <target name="update-version-info">
        <nant buildfile="${log4net.basedir}/examples/nant.build" target="update-version-info" inheritall="false" />
    </target>
    <target name="compile-examples" description="Build all examples">
        <nant buildfile="${log4net.basedir}/examples/nant.build" target="compile" inheritall="false" />
    </target>
    <target name="compile-extensions" description="Build all extensions">
        <nant buildfile="${log4net.basedir}/extensions/nant.build" target="compile" inheritall="false" />
    </target>
</project>