This repository was archived by the owner on Aug 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommon.xml
More file actions
executable file
·958 lines (694 loc) · 37.5 KB
/
common.xml
File metadata and controls
executable file
·958 lines (694 loc) · 37.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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
<!--
*
* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 jmochel
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the <ORGANIZATION> nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="commonbuild" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:eclipse="antlib:com.unicorntoast.ant.ivy.eclipse" default="Build">
<!--
#############################################
What we are automating here:
Code Generation
Configuration Management
Software Bui
Software Integration
Regression Testing
Documentation
Software Release
Software Deployment
Web Page Generation
Web Deployment
What we are not automating:
Feasibility STudies/Evals
Analysis
Requirements
Use Cases
Code Design
Architecture
Coding
#############################################
#############################################
The Intentions of this build system are
to provide a system build that is:
#############################################
Complete
Repeatable
Informative
Schedulable
Portable
#############################################
Directory Structure
#############################################
/common-build // Common Folder at the top level
/project
/project/common-build // Common Build Folder at the top level
/project/root // Top Level 'build all' project
/project/components
/project/components/component1
/project/components/component1/build.xml
/project/components/component1/src
/project/components/component1/src/main
/project/components/component1/src/main/java
/project/components/component1/src/main/conf
/project/components/component1/src/test
/project/components/component1/src/test/java
/project/components/component1/src/test/conf
/project/components/component1/gen-src
/project/components/component1/gen-src/main
/project/components/component1/gen-src/main/java
/project/components/component1/gen-src/main/conf
/project/components/component1/gen-src/test
/project/components/component1/gen-src/test/java
/project/components/component1/gen-src/test/conf
/project/components/component1/target/classes
/project/components/component1/target/test-classes
/project/components/component1/target/distrib
/project/components/component1/target/reports
/project/components/component1/target/reports/testing
#############################################
Overall Documentation of the build life cycle
#############################################
Clean - Remove all build artifacts from the file system.
Validation and Configuration Targets
====================================
Init - Initialize the build system. All properties should be set here.
Prep - Prepare the file system for the build.
GetDependencies - Resolve all dependencies.
Generate Code and Resources
====================================
Gen - Generate or Preprocess source code and resources of any type.
All generated sources go to the gen-src folder.
Build
====================================
Build - Build anything that can be compiled or assembled.
UnitTest - Execute any tests that can be performed without deployment
Component Package and Test
====================================
Pkg - Package anything that can be packaged.
Verify - Establish the internal integrity of the package
Deploy - Deploy any packages that need to be deployed.
SmokeTest - Execute any smoke tests
Staging, Sharing and Release
====================================
Stage - Publish the build artifacts for local (i.e. machine local) usage.
Share - Publish the build artifacts for team wide usage.
Release - Publish the build artifacts for general (i.e. network) usage.
Integration Testing
====================================
IntegrationTest - Execute any smoke tests
Global Release
====================================
Perf - Performance test deployed elements
Val - Running coding guideline checks.
Doc - Document the stuff. Generates Javadoc , etc...
Properties
====================================
All component projects must define the 'component.type' property.
The component type will be used to determine what submodule targets will be called.
The common.XML defines a few common ones, and provides the code for those types.
to be one of the following:
'root' - A top level project whos sole job is to call other projects
- There should RARELY be more that one of these in a project hierarchy.
'common' - A top level project that contains all common build scripts and such.
- There should never be more that one of these in a project hierarchy.
- It will typically only describe those dependencies that are build specific
'j2ee_ejb' - Any EJB3 Session or Entity Bean
'j2ee_web_app' - EJB3 J2EE Web Application
'j2ee_enterprise_app' - EJB3 J2EE Enterprise Application
-->
<!--
How IVY works
Configure configures the resolvers with appropriate
configuration information as found in the ivyconf.xml file.
The build system assumes several repositories and a cache.
1. local (or personal)
2. shared (or team)
3. global (or world)
served by several resolvers.
Resolve looks at the local ivy.xml file and looks for the
dependencies and brings them down to the local cache
(** TODO PUT NAME OF PERTINENT property here **)
Repository (local)
Default location is ${ivy.default.ivy.user.dir}/local
Repository (shared)
Default location is ${ivy.default.ivy.user.dir}/shared
Repository (public)
Default location is ivyrep
IVY Cache =======================> Project Lib Dir
-->
<!-- The folder containing all the common build elements -->
<dirname property = "commonbuild.root.dir" file = "${ant.file.commonbuild}"/>
<!--
<property environment="env"></property>
<property name="env.HOME" value="${env.USERPROFILE}"/>
<echo message="Pulling the common build repository location from ${env.HOME}/common-build.repository.properties" />
<property file="${env.HOME}/common-build.repository.properties" />
-->
<!-- If no other configuration has taken effect, use the defaults. These defaults assume that you have a machine named artifactrepo with nexus on it -->
<!-- <property name="common-build.enterprise.repository" value="http://artifactrepo:8080/nexus"/> -->
<property name="ivy.install.version" value="2.3.0-rc2" />
<property name="ivy.install.jar.dir" value="${commonbuild.root.dir}/target/lib" />
<property name="ivy.install.jar.file" value="${ivy.install.jar.dir}/ivy-${ivy.install.version}.jar" />
<property name="ivy-tools.install.version" value="v5" />
<property name="ivy-tools.install.jar.dir" value="${commonbuild.root.dir}/target/lib" />
<property name="ivy-tools.install.jar.file" value="${ivy-tools.install.jar.dir}/ant-ivy-tools-${ivy-tools.install.version}.jar" />
<property name="testng.install.version" value="6.3.1" />
<property name="testng.install.jar.dir" value="${commonbuild.root.dir}/target/lib" />
<property name="testng.install.jar.file" value="${testng.install.jar.dir}/testng-${testng.install.version}.jar" />
<property name="onejar.install.version" value="0.97" />
<property name="onejar.install.jar.dir" value="${commonbuild.root.dir}/target/lib" />
<property name="onejar.install.jar.file" value="${onejar.install.jar.dir}/one-jar-ant-tasks-${onejar.install.version}.jar" />
<condition property="onejar.installed">
<available file="${onejar.install.jar.file}" property="onejar.installed" value="true"/>
</condition>
<condition property="testng.installed">
<available file="${testng.install.jar.file}" property="testng.installed" value="true"/>
</condition>
<condition property="ivy.installed">
<available file="${ivy.install.jar.file}" property="ivy.installed" value="true"/>
</condition>
<condition property="ivy-tools.installed">
<available file="${ivy-tools.install.jar.file}" property="ivy-tools.installed" value="true"/>
</condition>
<target name="DownloadIvy" unless="ivy.installed">
<mkdir dir="${ivy.install.jar.dir}"/>
<echo message="Downloading Ivy Tasks..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.install.jar.file}" usetimestamp="true"/>
</target>
<target name="DownloadIvyTools" unless="ivy.installed">
<mkdir dir="${ivy-tools.install.jar.dir}"/>
<echo message="Downloading Ivy Tools ..."/>
<get src="http://ant-ivy-tools.googlecode.com/files/ant-ivy-tools-${ivy-tools.install.version}.jar" dest="${ivy-tools.install.jar.file}" usetimestamp="true"/>
</target>
<target name="DownloadTestNG" unless="testng.installed">
<mkdir dir="${testng.install.jar.dir}"/>
<echo message="Downloading TestNG Tasks..."/>
<get src="http://repo1.maven.org/maven2/org/testng/testng/${testng.install.version}/testng-${testng.install.version}.jar" dest="${testng.install.jar.file}" usetimestamp="true"/>
</target>
<target name="DownloadOneJar" unless="onejar.installed">
<mkdir dir="${onejar.install.jar.dir}"/>
<echo message="Downloading One Jar Tasks..."/>
<get src="http://sourceforge.net/projects/one-jar/files/one-jar/one-jar-${onejar.install.version}/one-jar-ant-task-${onejar.install.version}.jar/download" dest="${onejar.install.jar.file}" usetimestamp="true"/>
</target>
<target name="InstallCommonAntTasks" depends="DownloadIvy, DownloadTestNG, DownloadOneJar, DownloadIvyTools" description="--> install common ant tasks">
<path id="anttask.install.lib.path">
<fileset dir="${ivy.install.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="anttask.install.lib.path" />
<taskdef resource="com/unicorntoast/ant/ivy/eclipse/antlib.xml" uri="antlib:com.unicorntoast.ant.ivy.eclipse" classpathref="anttask.install.lib.path" />
<taskdef resource="testngtasks" classpathref="anttask.install.lib.path" />
<taskdef name="one-jar" classname="com.simontuffs.onejar.ant.OneJarTask" classpathref="anttask.install.lib.path" onerror="report"/>
</target>
<!--
Generates an IVY dependency report for the project. By default this
report is a set of HTML files stored in the target directory
-->
<target name="Report" depends="GetDependencies">
<report todir="${comp.target.dir}"/>
</target>
<!--
Clean is the common clean target. It deletes the top level folders used for
built components as well as generated sources.
-->
<target name="Clean" depends="Init" description="Cleans the components build artifacts ">
<echo>Deleting the generated source folders</echo>
<delete dir="${comp.gen.src.dir}" />
<echo>Deleting the build target folders</echo>
<delete dir="${comp.target.dir}" />
<echo>Deleting the lib folders</echo>
<delete dir="${comp.lib.dir}" />
</target>
<!--
====================================
Validation and Configuration Targets
====================================
-->
<!--
Init is the common initialization target.
All component projects must define the 'component.type' property
to be 'java_lib', 'etc...'
-->
<target name="Init" depends="InstallCommonAntTasks" description="Initialize the build system. All properties should be set here.">
<!--
Reporting
-->
<echo message="========================================================================="/>
<echo message=" NOW BUILDING ${ant.project.name} "/>
<echo message="========================================================================="/>
<echo message=" Basedir = ${basedir}" />
<echo message=" Project Build File = ${ant.file.commonbuild}"/>
<echo message=" Component Build File = ${ant.file}"/>
<echo message="========================================================================="/>
<echo message="========================================================================="/>
<!-- Get the timestamp for the start of each build -->
<tstamp/>
<!--
Versioning Info
-->
<!--
The project.version and build.number properties can be and should be overridden
on the command line in the CI builds. In normal development builds these values
should suffice.
-->
<property environment="env" /> <!-- Read in the environment as properties -->
<property name="project.version" value="working"/> <!-- May have already been set by Hudson -->
<!--
Check if the BUILD_NUMBER property exists, if it does we are running inside of
Hudson and should be using the supplied build number
-->
<condition property="build.number" value="${env.BUILD_NUMBER}" >
<isset property="env.BUILD_NUMBER"/>
</condition>
<property name="build.number" value="0" />
<property name="component.version" value="${project.version}.${build.number}"/>
<!--
The IVY Cache and Local folders are ceated in the folder given by the
environment variable IVY_HOME and referenced in the ivy-settings.xml file.
-->
<!--
Top level folders
-->
<!-- Defaults to the user name -->
<property name="dev.user.name" value="${user.name}"/>
<!-- Put machine name in -->
<property name="dev.machine" value="localhost"/>
<!-- Conformations are test, debug, profile -->
<property name="dev.conformation" value="test"/>
<!-- Configuration Names are anything that allows you to differentiate but the reserved one is "default" -->
<property name="dev.configuration" value="default"/>
<!--
Top level folders
-->
<!--
Component level folders
-->
<property name="comp.src.dir" value="${basedir}/src"/>
<property name="comp.gen.src.dir" value="${basedir}/gen-src"/>
<property name="comp.target.dir" value="${basedir}/target"/>
<property name="comp.lib.dir" value="${basedir}/lib"/>
<!--
Component level main source folders
-->
<property name="comp.src.main.dir" value="${comp.src.dir}/main"/>
<property name="comp.src.main.java.dir" value="${comp.src.main.dir}/java"/>
<property name="comp.src.main.conf.dir" value="${comp.src.main.dir}/conf"/>
<property name="comp.src.main.conf.templates.dir" value="${comp.src.main.conf.dir}/templates"/>
<!--
Component level generated source folders for main (i.e. non-test) code
-->
<property name="comp.gen.src.main.dir" value="${comp.gen.src.dir}/main"/>
<property name="comp.gen.src.main.java.dir" value="${comp.gen.src.main.dir}/java"/>
<property name="comp.gen.src.main.conf.dir" value="${comp.gen.src.main.dir}/conf"/>
<!--
Component level test source folders for test code
-->
<property name="comp.src.test.dir" value="${comp.src.dir}/test"/>
<property name="comp.src.test.java.dir" value="${comp.src.test.dir}/java"/>
<property name="comp.src.test.sql.dir" value="${comp.src.test.dir}/sql"/>
<property name="comp.src.test.conf.dir" value="${comp.src.test.dir}/conf"/>
<!--
Component level generated source folders for main (i.e. non-test) code
-->
<property name="comp.gen.src.test.dir" value="${comp.gen.src.dir}/test"/>
<property name="comp.gen.src.test.java.dir" value="${comp.gen.src.test.dir}/java"/>
<property name="comp.gen.src.test.conf.dir" value="${comp.gen.src.test.dir}/conf"/>
<property name="comp.gen.src.test.sql.dir" value="${comp.gen.src.test.dir}/sql"/>
<!--
Component level target class folders
-->
<property name="comp.target.main.classes.dir" value="${comp.target.dir}/classes"/>
<property name="comp.target.test.classes.dir" value="${comp.target.dir}/test-classes"/>
<!--
Component level target dependencies folders.
Used for storing dependent jars, wars, ears, resources, etc used in building a given target
-->
<property name="comp.target.main.dependencies.dir" value="${comp.target.dir}/dependencies"/>
<property name="comp.target.dist.dir" value="${comp.target.dir}/distrib"/>
<property name="comp.target.dist.jar.dir" value="${comp.target.dist.dir}/jars"/>
<property name="comp.target.dist.war.dir" value="${comp.target.dist.dir}/wars"/>
<property name="comp.target.dist.ear.dir" value="${comp.target.dist.dir}/ears"/>
<property name="comp.target.dist.ejb.dir" value="${comp.target.dist.dir}/ejbs"/>
<property name="comp.target.dist.javadocs.dir" value="${comp.target.dist.dir}/javadocs"/>
<property name="comp.target.dist.sources.dir" value="${comp.target.dist.dir}/sources"/>
<property name="comp.target.dist.installer.dir" value="${comp.target.dist.dir}/installers"/>
<property name="comp.target.javadocs.dir" value="${comp.target.dir}/javadoc"/>
<property name="comp.target.reports.dir" value="${comp.target.dir}/reports"/>
<property name="comp.target.reports.test.dir" value="${comp.target.reports.dir}/test"/>
<property name="comp.target.reports.validation.dir" value="${comp.target.reports.dir}/validation"/>
<!--
Flag the existence of Unit and Smoke test source is available
-->
<property name="comp.src.test.unit.java.pattern" value="**/*Test.java"/>
<property name="comp.src.test.smoke.java.pattern" value="**/*SmokeTest.java"/>
<available file="${comp.src.test.java.dir}" type="dir" property="comp.src.test.unit.java.dir.present" />
<pathconvert property="comp.src.test.smoke.java.dir.present" setonempty="false" pathsep=" " >
<path location="${comp.src.test.java.dir}/${comp.src.test.smoke.java.pattern}"/>
</pathconvert>
<!--
Flag the existence of testng.xml file
-->
<property name="testng.file" value="${comp.src.test.java.dir}/testng.xml"/>
<available file="${testng.file}" type="file" property="testng.file.present"/>
<!--
Library resolution folders
-->
<!--
Ivy Configuration
-->
<property name="ivy.distrib.dir" value="${comp.target.dist.dir}"/>
<!--
<property name="ivy.local.default.ivy.pattern" value="[organisation]/[module]/ivys/ivy-[revision].xml"/>
-->
</target>
<!--
Prep is the common preparation target.
At the end of its execution, it calls a project type specific target Such as Prep.common
-->
<target name="Prep" depends="Init" description="Prepares the file system for building the component">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Prep "/>
<echo message=" ============================================="/>
<echo message=" "/>
<mkdir dir="${comp.target.main.classes.dir}"/>
<mkdir dir="${comp.target.test.classes.dir}"/>
<mkdir dir="${comp.target.dist.dir}"/>
<mkdir dir="${comp.gen.src.main.java.dir}"/>
<mkdir dir="${comp.gen.src.main.conf.dir}"/>
<mkdir dir="${comp.gen.src.test.sql.dir}"/>
<mkdir dir="${comp.target.reports.test.dir}"/>
<mkdir dir="${comp.target.reports.validation.dir}"/>
<mkdir dir="${comp.target.dist.javadocs.dir}"/>
<mkdir dir="${comp.target.javadocs.dir}"/>
<mkdir dir="${comp.target.dist.sources.dir}"/>
<antcall inheritRefs="true" target="Prep.${component.type}" />
</target>
<target name="Prep.root"/>
<target name="Prep.common"/>
<!--
GetDependencies is the common dependency resolution target.
-->
<target name="GetDependencies" depends="Prep" description="Resolve and (if necessary) retrieve dependencies.">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} GetDependencies "/>
<echo message=" ============================================="/>
<echo message=" "/>
<ivy:settings file="${commonbuild.root.dir}/ivy-settings.xml"/>
<ivy:resolve haltonfailure="true" />
<ivy:cachefileset setid="rslvd.build.set" conf="build" haltonfailure="false"/>
<ivy:cachepath pathid="rslvd.build.path" conf="build" haltonfailure="false"/>
<ivy:cachefileset setid="rslvd.compile.set" conf="compile" haltonfailure="false"/>
<ivy:cachepath pathid="rslvd.compile.path" conf="compile" haltonfailure="false"/>
<ivy:cachefileset setid="rslvd.provided.set" conf="provided" haltonfailure="false"/>
<ivy:cachepath pathid="rslvd.provided.path" conf="provided" haltonfailure="false"/>
<ivy:cachefileset setid="rslvd.deploy.set" conf="deploy" haltonfailure="false"/>
<ivy:cachepath pathid="rslvd.deploy.path" conf="deploy" haltonfailure="false"/>
<ivy:cachefileset setid="rslvd.test.set" conf="test" haltonfailure="false"/>
<ivy:cachepath pathid="rslvd.test.path" conf="test" haltonfailure="false"/>
<pathconvert property="resolved.test.dependencies" refid="rslvd.test.path"/>
<path id="resolved.build.tool.path">
<path refid="rslvd.build.path" />
</path>
<path id="resolved.build.and.compiled.path">
<path refid="rslvd.compile.path"/>
<path refid="rslvd.provided.path"/>
<path location="${comp.target.main.classes.dir}"/>
</path>
<path id="resolved.build.and.testable.path">
<path refid="resolved.build.and.compiled.path"/>
<path refid="rslvd.test.path"/>
<path location="${comp.target.test.classes.dir}"/>
</path>
</target>
<!--
Generates a new .classpath file for Eclipse
-->
<target name="Update" depends="GetDependencies" description="description">
<eclipse:classpath>
<entry kind="src" path="src/main/java" output="target/classes" />
<entry kind="src" path="src/test/java" output="target/test-classes" />
<entry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
<ivy settings="${commonbuild.root.dir}/ivy-settings.xml" input="ivy.xml" />
</eclipse:classpath>
</target>
<!--
====================================
Generate Code and Resources
====================================
-->
<!--
Gen is the common source code generation target.
Component 'instance specific' code generation occurs in the Gen.ComponentType target
The Comp.Gen target has a default implementation which can be overridden in the component's build.xml file
-->
<target name="Gen" depends="GetDependencies">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Generate Source "/>
<echo message=" ============================================="/>
<echo message=" "/>
<antcall inheritRefs="true" target="Gen.${component.type}" />
</target>
<target name="Gen.common"/>
<target name="Gen.root"/>
<!--
====================================
Build
====================================
-->
<!--
Build is the common build target.
-->
<target name="Build" depends="Gen">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Build "/>
<echo message=" ============================================="/>
<echo message=" "/>
<antcall inheritRefs="true" target="Build.${component.type}" />
</target>
<!--
-->
<target name="Build.root" >
</target>
<target name="Build.common"/>
<!--
Compile.Java is the common java compilation target.
It is used by a variety of build targets
-->
<target name="Compile.Core.Java" >
<javac destdir="${comp.target.main.classes.dir}" debug="true" target="1.5" >
<src path="${comp.src.main.java.dir}"/>
<src path="${comp.gen.src.main.java.dir}"/>
<classpath refid="resolved.build.and.compiled.path"/>
</javac>
<copy todir="${comp.target.main.classes.dir}">
<fileset dir="${comp.src.main.java.dir}">
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${comp.gen.src.main.java.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="Compile.Test.Java" >
<javac destdir="${comp.target.test.classes.dir}" debug="true" target="1.5">
<src path="${comp.src.test.java.dir}"/>
<classpath refid="resolved.build.and.testable.path"/>
</javac>
<copy todir="${comp.target.main.classes.dir}">
<fileset dir="${comp.src.test.java.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!--
UnitTest is the Unit Testing resolution target.
This requires a file at src/java/test/testng.xml.
-->
<target name="UnitTest" depends="GetDependencies" description="Unit test all non-deployable code" if="testng.file.present">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Unit Test "/>
<echo message=" ============================================="/>
<echo message=" "/>
<!-- Execute all the unit tests in the component's testng.xml file -->
<echo>${testng.file}</echo>
<testng junit="" classpathref="resolved.build.and.testable.path" outputdir="${comp.target.reports.test.dir}" useDefaultListeners="false"
listeners="org.testng.reporters.XMLReporter"
haltOnFailure="false">
<xmlfileset dir="${comp.src.test.java.dir}" includes="testng.xml"/>
</testng>
</target>
<!--
====================================
Component Package and Test
====================================
-->
<!--
Pkg is the common packaging target.
-->
<target name="Pkg" depends="Build" description="Packages the component according to its type" >
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Package "/>
<echo message=" ============================================="/>
<echo message=" "/>
<!--
Package the Javadoc
-->
<javadoc
destdir="${comp.target.javadocs.dir}"
windowtitle="API for ${component.version}"
classpathref="resolved.build.and.compiled.path"
verbose="false"
author="no"
version="no"
nodeprecated="true"
public="true"
>
<arg value="-quiet"/>
<sourcepath>
<path location="${comp.gen.src.main.java.dir}"></path>
<path location="${comp.src.main.java.dir}"></path>
</sourcepath>
</javadoc>
<jar basedir="${comp.target.javadocs.dir}" jarfile="${comp.target.dist.javadocs.dir}/${ivy.module}-${component.version}-javadoc.jar" />
<!--
Package the source jar
-->
<jar jarfile="${comp.target.dist.sources.dir}/${ivy.module}-${component.version}-source.jar" >
<fileset dir="${comp.src.main.java.dir}" includes="**/*.java"/>
<fileset dir="${comp.gen.src.main.java.dir}" includes="**/*.java"/>
</jar>
<antcall inheritRefs="true" target="Pkg.${component.type}"/>
</target>
<target name="Pkg.common"/>
<target name="Pkg.root">
</target>
<!--
Verify is the common verification target.
Component 'instance specific' verification occurs in the Comp.Verify target
The Comp.Verify target has a default implementation which can be overridden in the component's build.xml file
-->
<target name="Verify" depends="Pkg" description="Validates that the package is a valid package">
<antcall inheritRefs="true" target="Verify.${component.type}"/>
</target>
<!--
Deploy is the common deployment target.
-->
<target name="Deploy" depends="Stage" description="Deploys applications and test packages">
<antcall inheritRefs="true" target="Deploy.${component.type}.to.${appserver}"/>
</target>
<target name="Shutdown.jboss" depends="Init" >
<java classname="org.jboss.Shutdown" classpath="${appserver.dir}/bin/shutdown.jar;${appserver.dir}/bin/../client/jbossall-client.jar">
<env key="JAVA_HOME" value="${java.home}" />
<jvmarg value="-Djboss.boot.loader.name=run.bat"/>
<arg line="--server=localhost:${jndi.port}"/>
</java>
</target>
<!--
SmokeTest is the common smoke testing target.
-->
<target name="SmokeTest" description="Smoke tests the already deployed component" depends="Init" >
<antcall inheritRefs="true" target="SmokeTest.Test.${component.type}"/>
</target>
<target name="PopulateForSmokeTest" depends="GetDependencies" description="Populates the database for the Smoke Tests">
<antcall inheritRefs="true" target="PopulateForSmokeTest.${rdbms.name}" />
</target>
<target name="PopulateForSmokeTest.oracle" depends="GetDependencies"/>
<target name="PopulateForSmokeTest.sqlserver" depends="GetDependencies"/>
<!--
====================================
Local Release
====================================
-->
<!--
Stage is the local publishing target. It makes a component available for local
(non-shared) usage. i.e. typically within the same build.
-->
<target name="Stage" depends="GetDependencies" description="Publish artifacts to the local repository">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Stage "/>
<echo message=" ============================================="/>
<echo message=" "/>
<ivy:deliver pubrevision="${component.version}"/>
<ivy:publish resolver="local" pubrevision="${component.version}" overwrite="true" conf="core,test"/>
</target>
<target name="Share" depends="GetDependencies" description="Publish artifacts with ivy">
<echo message=" ============================================="/>
<echo message=" ${ant.project.name} Share "/>
<echo message=" ============================================="/>
<echo message=" "/>
<ivy:deliver pubrevision="${component.version}"/>
<ivy:publish resolver="release" pubrevision="${component.version}" overwrite="true" conf="core,test"/>
</target>
<!--
IntegrationTest is the common integration testing target.
-->
<target name="IntegrationTest" depends="Init" description="Performs an integration test agains the overall system"/>
<target name="GenerateDependencyGraph" description="Generate jar dependency graph" depends="GetDependencies">
<ivy:report todir="${comp.target.reports.dir}" graph="true"/>
</target>
<target name="GenerateRepositoryDependencyGraph" description="Generate jar dependency graph" depends="GetDependencies">
<ivy:repreport todir="${comp.target.reports.dir}" graph="true"/>
</target>
<target name="CleanCache" depends="Init" description="Removes all project specific artifacts from the cache and local storage">
<delete dir="${ivy.local.default.root}/${ivy.org}" failonerror="true" verbose="true"/>
<delete dir="${ivy.cache.dir}/${ivy.org}" failonerror="true" verbose="true"/>
</target>
<!--
Project Specific targets
These targets are intentionally designed to be overridden by the
components projects.
-->
<!--
Common Macros
-->
<!--
Iterates over ALL the projects build files and applies the target
-->
<macrodef name="iterate">
<attribute name="parentfolder" default=""/>
<attribute name="target" default=""/>
<sequential>
<subant target="@{target}">
<fileset dir="@{parentfolder}" includes="**/build.xml" />
</subant>
</sequential>
</macrodef>
<!--
Iterates over ALL the project build files (in dependency order) and applies the target
-->
<macrodef name="iterate-in-build-order">
<attribute name="parentfolder" default=""/>
<attribute name="target" default=""/>
<attribute name="reverse" default="false"/>
<sequential>
<ivy:buildlist reverse="@{reverse}" reference="ordered-build-path">
<fileset dir="@{parentfolder}" includes="**/build.xml" excludes="**/root/build.xml"/>
</ivy:buildlist>
<subant target="@{target}" buildpathref="ordered-build-path"/>
</sequential>
</macrodef>
</project>