aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
blob: d2245ec9452283063dfc26b34dc903c8c1605f3f (plain)
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
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="tools/antipede/resources/stylesheets/layout.xsl"?>
<!DOCTYPE project [
  <!-- antipede -->    
  <!ENTITY import-antipede  SYSTEM "./tools/antipede/build.xtarget"> 
]>
<project default="interactive" basedir="." name="project build file">

<description>

                   * ===================================== *
                   |   Krysalis Centipede Build System     |
                   * ===================================== *      
                                     by               
                                             
                   Nicola Ken Barozzi (nicolaken@apache.org)
                   Marc Johnson (mjohnson@apache.org)       
                     
                     started as an extension of the
                     the Apache Cocoon Build System 
                     (http://xml.apache.org/cocoon/)
                                     by
                   Stefano Mazzocchi (stefano@apache.org)
                   Carsten Ziegeler (cziegeler@apache.org)
                   

Installing the build tools
==========================

The Krysalis Centipede build system is based on Apache Ant, 
which is a Java building tool originally developed for the Tomcat 
project but now used in many other Apache projects and extended 
by many developers.

Ant is a little but very handy tool that uses a build file written in XML
(this file) as building instructions. For more information refer to
"http://jakarta.apache.org/ant/".

To make things easier for you, this distribution contains a precompiled
version of Ant and the build scripts take care of running it.

The only thing that you have to make sure, is the "JAVA_HOME" environment
property should be set to match the JVM you want to use.

That's all you have to do to be ready to go.


Building instructions
=====================

First, make sure your current working directory is where this very file 
is located. Then type

  ./build.sh (unix)
  .\build.bat (win32)

if everything is right and all the required packages are visible, this action
will start the build and prompt you with options.
Note, that if you do further development, compilation time is reduced since
Ant is able of detecting which files have changed and to recompile them at need.

Also, you'll note that reusing a single JVM instance for each task, increases
tremendously the performance of the whole build system, compared to other
tools (i.e. make or shell scripts) where a new JVM is started for each task.

Build targets
=============

The build system is not only responsible of compiling the project into a jar 
file, but is also responsible for creating the HTML documentation, javadocs,
distributions and web site. In fact, the file you have here is _exactly_ what
is used by project maintainers to take care of everything in the project,
no less and no more.

To know more about the available targets take a look at this file, which is
pretty self-explanatory, or run the build with "-projecthelp".

Build Dependencies
==================
Some components are optional and require special jar files to be compiled
and added to the application. Some of these jars are already included
in the distribution while others not.
For each optional package which is not available, a warning can be
printed.


                                            Happy hacking  :)

============================================================================
</description>
 
  <!-- =================================================================== -->
  <!-- Basic build targets for the project                                 -->
  <!-- =================================================================== -->

  <!-- =================================================================== -->
  <!-- Interactive build                                            -->
  <!-- =================================================================== -->
  <target name="interactive" description="Interactive Build" depends="-init">          
    <echo message="--------------------------------------------------------------"/>
    <echo message=" "/>    
    <echo message="          ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor}   [${YEAR}] "/>
    <echo message=" "/>    
    <echo message="--------------------------------------------------------------"/>
    <echo message="Building with ${ant.version}"/>  
    <echo message="using build file ${ant.file}"/>  
    <echo message="--------------------------------------------------------------"/>   
    <echo message=" These are the most common build targets."/>      
    <echo message=" You can also invoke them directly; see build.xml for more info. "/> 
    <echo message=" Builds will be in /build directory, distributions in /dist."/>        
    <echo message="  "/>    
    <echo message=" compile ---------- compiles the source code "/>     
    <echo message=" docs ------------- generates the html docs"/>        
    <echo message=" cleandocs -------- cleans the build docs directory"/>    
    <echo message=" javadocs --------- generates the API documentation"/>     
    <echo message=" test ------------- performs the jUnit tests"/>       
    <echo message=" clean ------------ cleans the build directory"/>    
    <echo message=" dist ------------- creates src and bin distributions"/>    
    <echo message=" scratchpad ------- build-run scratchpad code"/>       
    <echo message=" contrib ---------- build-run contributed code"/>    
    <echo message=" generate-records - generate excel records"/>    
    <echo message=" generate-types --- generate word types"/>    

    <property name="input.selection" value="compile"/>        
    <centipede-user-input name="input.selection">Please select a target </centipede-user-input>   

    <pathconvert pathsep="," property="antipede.gif.url">
      <path>
        <filelist dir="./tools/antipede/resources/images" files="antipede.gif"/>
      </path>
    </pathconvert>
   <splash imageurl="file:/${antipede.gif.url}" showduration="100"/>  
 
    <antcall target="${input.selection}"/>
    
  </target>

  <!-- =================================================================== -->
  <!-- Interactive scratchpad builds                                       -->
  <!-- =================================================================== -->
  <target name="scratchpad" depends="-init" description="Interactive Scratchpad Build">
    <echo message="--------------------------------------------------------------"/>
    <echo message=" "/>    
    <echo message="          ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor} SCRATCHPAD "/>
    <echo message=" "/>    
    <echo message="--------------------------------------------------------------"/>  
    <echo message="Building with ${ant.version}"/>  
    <echo message="using build file ${ant.file}"/>  
    <echo message="--------------------------------------------------------------"/>   
    <echo message=" "/>        
    <echo message=" These are SCRATCHPAD BUILDS. They are not guaranteed to work."/>
    <echo message=" You have been warned. "/>
    <echo message=" "/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" "/>

    <property name="input.selection" value=""/>
    <centipede-user-input name="input.selection">Please select a target </centipede-user-input>

    <ant antfile="${xlayout.source.scratchpad.targets.dir}/${input.selection}/xbuild.xml"/>

  </target>

  <!-- =================================================================== -->
  <!-- Interactive contrib builds                                       -->
  <!-- =================================================================== -->
  <target name="contrib" depends="-init" description="Interactive Contributors' Build">
    <echo message="--------------------------------------------------------------"/>
    <echo message=" "/>    
    <echo message="          ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor}  CONTRIB"/>
    <echo message=" "/>    
    <echo message="--------------------------------------------------------------"/>
    <echo message="Building with ${ant.version}"/>  
    <echo message="using build file ${ant.file}"/>  
    <echo message="--------------------------------------------------------------"/>   
    <echo message=" "/>        
    <echo message=" These are CONTRIB BUILDS. They are not guaranteed to work."/>
    <echo message=" You have been warned. "/>
    <echo message=" "/>
    <echo message=" poibrowser - POIBrowser 0.10 GUI POI Viewer"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" -"/>
    <echo message=" "/>
    <property name="input.selection" value="poibrowser"/>
    <centipede-user-input name="input.selection">Please select a target </centipede-user-input>

    <ant antfile="${xlayout.source.contributions.targets.dir}/${input.selection}/xbuild.xml"/>
    
  </target>


  <!-- ================================== -->
  <!--              Compile               -->
  <!-- ================================== -->

  <target  name="compile"   depends="-init"
           description="Compile java source code">
           
    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="compile"/> 
    </antcall>
    
  </target>               

  <!-- ================================== -->
  <!--             Build jars             -->
  <!-- ================================== -->

  <target  name="jar"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="package"/> 
    </antcall>
    
  </target>     

  <!-- ================================== -->
  <!--         Build distributions        -->
  <!-- ================================== -->

  <target  name="dist"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="dist"/> 
    </antcall>
    
  </target>     

  <!-- ================================== -->
  <!--         Clean build dir            -->
  <!-- ================================== -->

  <target  name="clean"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="clean"/> 
    </antcall>
    
  </target>     

  <!-- ================================== -->
  <!--         Run Junit tests            -->
  <!-- ================================== -->
  
  <target  name="test"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="junit"/> 
      <param name="cent-target" value="test"/> 
    </antcall>
 
    <antcall target="call-cent">
      <param name="cent-name"   value="junit"/> 
      <param name="cent-target" value="report"/> 
    </antcall>
   
  </target>     

  <!-- ================================== -->
  <!--      Generate project metrics      -->
  <!-- ================================== -->
  
  <target  name="metrics"   depends="-init"
           description="Generate project metrics">

    <antcall target="call-cent">
      <param name="cent-name"   value="jdepend"/>
      <param name="cent-target" value="jdepend-html"/> 
    </antcall>
 
 </target>     

  
  <!-- ================================== -->
  <!--    Generates the documentation     -->
  <!-- ================================== -->
  
  <target  name="docs"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="forrest"/> 
      <param name="cent-target" value="docs"/> 
    </antcall>
 
  </target>     

  <!-- ================================== -->
  <!--       Generates the javadocs       -->
  <!-- ================================== -->
  
  <target  name="javadocs"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="javadocs"/> 
    </antcall>
    
  </target>     

  <!-- ================================== -->
  <!--       Generate UML                 -->
  <!-- ================================== -->
  
  <target  name="uml"   depends="-init"
           description="generate-uml">
  <!--
  <javadoc packagenames="org.apache.poi.*"
           sourcepath="./src/java"
           destdir="docs/metrics">

     <doclet name="JP.co.esm.caddies.doclets.UMLDoclet"
             path="./tools/antipede/lib/UMLDoclet.jar">
        <param name="-d" value="docs/metrics"/>
     </doclet>

  </javadoc>
    -->
    
        <javadoc packagenames="${xgump.module.project.package}.*"
             sourcepath="${xlayout.build.java.dir}"
             destdir="${xlayout.build.documentation.javadocs.dir}"
             author="true"
             version="true"
             use="true"
             failonerror="true"
             noindex="true"
             windowtitle="${package-name} ${package-version}  API"
             doctitle="${package-name} ${package-version}  API"
             bottom="Copyright &#169; ${YEAR} Apache ${package-name} project. All Rights Reserved."
             stylesheetfile="${centipede.cent.dir}/resources/stylesheets/javadoc.css">
 
     <classpath>
       <path>
          <fileset dir="${xlayout.library.dir}" casesensitive="yes"> 
           <patternset>
             <include name="*/*.jar"/>
             <include name="*/*.zip"/>
           </patternset>
         </fileset>  
       </path> 
     </classpath>
      <doclet name="JP.co.esm.caddies.doclets.UMLDoclet"
             path="./tools/antipede/lib/UMLDoclet.jar">
        <param name="-d" value="docs/metrics"/>
     </doclet>
     
    </javadoc>

  </target>     

  <!-- ================================== -->
  <!--       Generate records                -->
  <!-- ================================== -->
  
  <target  name="generate-records"   depends="-init"
           description="generate-records">

    <ant antfile="${xlayout.source.targets.dir}/record-generation/xbuild.xml"
            target="generate-records"/>
    
  </target>     

  <!-- ================================== -->
  <!--       Generate types                -->
  <!-- ================================== -->
  
  <target  name="generate-types"   depends="-init"
           description="generate-types">

    <ant antfile="${xlayout.source.targets.dir}/record-generation/xbuild.xml"
            target="generate-types"/>
    
  </target>     

  <!-- ================================== -->
  <!--       Test the main module stuff   -->
  <!-- ================================== -->
  
  <target  name="testmodule"   
           depends="clean, compile, test, jar, docs"
           description="Testing that all major targets work; useful before a commit"/>
           
           
  <!-- ================================== -->
  <!--        Target used by Gump         -->
  <!-- ================================== -->
  
  <target  name="gump"   
           depends="clean, compile, test, jar, docs, javadocs, metrics"
           description="Target used by Gump"/>
           

  <!-- ================================== -->
  <!--        Generate all                -->
  <!-- ================================== -->
  
  <target  name="all"   
           depends="gump"
           description="Generate all"/>
           
  <!-- ================================== -->
  <!--   Create a cent.jar package        -->
  <!--   using an already deployed cent   -->
  <!-- ================================== -->
  
  <target  name="jar-cent"   depends="-init"
           description="Compile java source code">

    <antcall target="call-cent">
      <param name="cent-name"   value="centipede"/> 
      <param name="cent-target" value="jar-cent"/> 
    </antcall>
    
  </target>     

  <!-- =================================================================== -->
  <!-- Import Ant-Centipede -init targets - sets up basic build stuff                          -->
  <!-- =================================================================== -->
  <!--  
        This is the target that initializes tasks and properties used
        commonly in every other target.
        
        Remember to add depends="-init" to every target, so that this
        target is called before any other.
                 
        This target is internal; to make it unusable from the commandline,
        its name starts with a hyphen. To make it invisible when
        using -projecthelp, it lacks a description.
  -->      

    &import-antipede;
      
</project>