source: fedd/abac-src/ttg/demo/build.xml @ e19b75c

axis_examplecompt_changesinfo-opsversion-2.00version-3.01version-3.02
Last change on this file since e19b75c was 8780cbec, checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago

ABAC sources from Cobham

  • Property mode set to 100644
File size: 18.6 KB
Line 
1<!--
2     General purpose build script for web applications and web services,
3     including enhanced support for deploying directly to a Tomcat 4
4     based server.
5
6     This build script assumes that the source code of your web application
7     is organized into the following subdirectories underneath the source
8     code directory from which you execute the build script:
9
10        docs                 Static documentation files to be copied to
11                             the "docs" subdirectory of your distribution.
12
13        src                  Java source code (and associated resource files)
14                             to be compiled to the "WEB-INF/classes"
15                             subdirectory of your web applicaiton.
16
17        web                  Static HTML, JSP, and other content (such as
18                             image files), including the WEB-INF subdirectory
19                             and its configuration file contents.
20
21     $Id: build.xml,v 1.9 2003/07/18 18:18:22 jjacobs Exp $
22-->
23
24
25<!-- A "project" describes a set of targets that may be requested
26     when Ant is executed.  The "default" attribute defines the
27     target which is executed if no specific target is requested,
28     and the "basedir" attribute defines the current working directory
29     from which Ant executes the requested task.  This is normally
30     set to the current working directory.
31-->
32
33<project name="ABAC Demo for July 2002" default="compile" basedir=".">
34
35
36
37<!-- ===================== Property Definitions =========================== -->
38
39
40<!--
41
42  Each of the following properties are used in the build script.
43  Values for these properties are set by the first place they are
44  defined, from the following list:
45
46  * Definitions on the "ant" command line (ant -Dfoo=bar compile).
47
48  * Definitions from a "build.properties" file in the top level
49    source directory of this application.
50
51  * Definitions from a "build.properties" file in the developer's
52    home directory.
53
54  * Default definitions in this build.xml file.
55
56  You will note below that property values can be composed based on the
57  contents of previously defined properties.  This is a powerful technique
58  that helps you minimize the number of changes required when your development
59  environment is modified.  Note that property composition is allowed within
60  "build.properties" files as well as in the "build.xml" script.
61
62-->
63
64  <property file="build.properties"/>
65  <property file="${user.home}/build.properties"/>
66
67
68<!-- ==================== File and Directory Names ======================== -->
69
70
71<!--
72
73  These properties generally define file and directory names (or paths) that
74  affect where the build process stores its outputs.
75
76  app.name             Base name of this application, used to
77                       construct filenames and directories.
78                       Defaults to "myapp".
79
80  app.path             Context path to which this application should be
81                       deployed (defaults to "/" plus the value of the
82                       "app.name" property).
83
84  app.version          Version number of this iteration of the application.
85
86  build.home           The directory into which the "prepare" and
87                       "compile" targets will generate their output.
88                       Defaults to "build".
89
90  catalina.home        The directory in which you have installed
91                       a binary distribution of Tomcat 4.  This will
92                       be used by the "deploy" target.
93
94  dist.home            The name of the base directory in which
95                       distribution files are created.
96                       Defaults to "dist".
97
98  manager.password     The login password of a user that is assigned the
99                       "manager" role (so that he or she can execute
100                       commands via the "/manager" web application)
101
102  manager.url          The URL of the "/manager" web application on the
103                       Tomcat installation to which we will deploy web
104                       applications and web services.
105
106  manager.username     The login username of a user that is assigned the
107                       "manager" role (so that he or she can execute
108                       commands via the "/manager" web application)
109
110-->
111
112  <property name="app.name"      value="demo"/>
113  <property name="app.path"      value="/${app.name}"/>
114  <property name="app.version"   value="0.1-dev"/>
115  <!--property name="catalina.home" value="/var/tomcat4"/--> 
116  <!-- UPDATE THIS! -->
117  <property name="catalina.home" value="/var/tomcat4"/> 
118  <property name="build.home"    value="${basedir}/build"/>
119  <property name="dist.home"     value="${basedir}/dist"/>
120  <property name="docs.home"     value="${basedir}/docs"/>
121  <property name="manager.url"   value="http://localhost:8080/manager"/>
122  <property name="manager.username"   value="admin"/>
123  <property name="manager.password"   value="admin"/>
124  <property name="src.home"      value="${basedir}/src"/>
125  <property name="web.home"      value="${basedir}/web"/>
126  <property name="deploy.home"   value="${catalina.home}/webapps${app.path}"/>
127
128
129<!-- ================== Custom Ant Task Definitions ======================= -->
130
131
132<!--
133
134  These properties define custom tasks for the Ant build tool that interact
135  with the "/manager" web application installed with Tomcat 4.  Before they
136  can be successfully utilized, you must perform the following steps:
137
138  - Copy the file "server/lib/catalina-ant.jar" from your Tomcat 4
139    installation into the "lib" directory of your Ant installation.
140
141  - Create a "build.properties" file in your application's top-level
142    source directory (or your user login home directory) that defines
143    appropriate values for the "manager.password", "manager.url", and
144    "manager.username" properties described above.
145
146  For more information about the Manager web application, and the functionality
147  of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>.
148
149-->
150
151  <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
152  <taskdef name="list"    classname="org.apache.catalina.ant.ListTask"/>
153  <taskdef name="reload"  classname="org.apache.catalina.ant.ReloadTask"/>
154  <taskdef name="remove"  classname="org.apache.catalina.ant.RemoveTask"/>
155
156
157<!--  ==================== Compilation Control Options ==================== -->
158
159<!--
160
161  These properties control option settings on the Javac compiler when it
162  is invoked using the <javac> task.
163
164  compile.debug        Should compilation include the debug option?
165
166  compile.deprecation  Should compilation include the deprecation option?
167
168  compile.optimize     Should compilation include the optimize option?
169
170-->
171
172  <property name="compile.debug"       value="true"/>
173  <property name="compile.deprecation" value="false"/>
174  <property name="compile.optimize"    value="true"/>
175
176
177
178<!-- ==================== External Dependencies =========================== -->
179
180
181<!--
182
183  Use property values to define the locations of external JAR files on which
184  your application will depend.  In general, these values will be used for
185  two purposes:
186  * Inclusion on the classpath that is passed to the Javac compiler
187  * Being copied into the "/WEB-INF/lib" directory during execution
188    of the "deploy" target.
189
190  Because we will automatically include all of the Java classes that Tomcat 4
191  exposes to web applications, we will not need to explicitly list any of those
192  dependencies.  You only need to worry about external dependencies for JAR
193  files that you are going to include inside your "/WEB-INF/lib" directory.
194
195-->
196  <!-- ABAC related libraries from Network Associates Laboratories -->
197  <property name="abac.jar" value="../classes/abac.jar"/>
198
199  <!-- RBTM role based trust management package from stanford -->
200  <property name="rbtm.jar" value="../../rbtm/classes/rbtm.jar"/>
201
202  <!-- RBTM role based trust management package from stanford -->
203  <property name="rtml.jar" value="../../rtml/lib/rtml.jar"/>
204
205  <!-- Policy configuration file for MedSup -->
206  <property name="medsup.txt" value="../test/simple/medsup/medsup.txt"/>
207
208  <!-- Policy configuration file for SEAdmirKDR -->
209  <property name="simple" value="../test/simple/sweden/SEAdmiraltyKDR.txt"/>
210
211  <!-- Policy configuration file for intersection policy -->
212  <property name="intersect" value="../test/intersect/SAdmir_inter.txt"/>
213
214  <!-- Policy configuration file for the gory details -->
215  <!--property name="linked" value="../test/rtml/sadmir.txt"/-->
216
217  <!-- Policy configuration files for the RTML linked scenario -->
218  <property name="rtml" value="../test/rtml/sadmir.txt"/>
219  <property name="rtml-xml" value="../test/rtml/sadmir.xml"/>
220  <property name="system.domain" value="../../rtml/schemas/SystemSpec.xml"/>
221
222  <!-- Policy configuration file for Swedish credentials to be sdiscovered -->
223  <property name="sadmir-rtml" value="../test/rtml/sadmir-dde.xml"/>
224
225  <!-- Policy configuration file for Swedish credentials to be sdiscovered -->
226  <property name="se-rtml" value="../test/rtml/se.xml"/>
227
228  <!-- Policy configuration file for Swedish credentials to be sdiscovered -->
229  <property name="usn-rtml" value="../test/rtml/usn.xml"/>
230
231  <!-- Policy configuration file for GENI demo -->
232  <property name="geni" value="../test/geni/geni.txt"/>
233<!-- ==================== Compilation Classpath =========================== -->
234
235<!--
236
237  Rather than relying on the CLASSPATH environment variable, Ant includes
238  features that makes it easy to dynamically construct the classpath you
239  need for each compilation.  The example below constructs the compile
240  classpath to include the servlet.jar file, as well as the other components
241  that Tomcat makes available to web applications automatically, plus anything
242  that you explicitly added.
243
244-->
245
246  <path id="compile.classpath">
247
248    <!-- Include all JAR files that will be included in /WEB-INF/lib -->
249    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
250
251    <pathelement location="${abac.jar}"/>
252    <pathelement location="${rbtm.jar}"/>
253    <pathelement location="${rtml.jar}"/>
254
255    <!-- Include all elements that Tomcat exposes to applications -->
256    <pathelement location="${catalina.home}/common/classes"/>
257    <fileset dir="${catalina.home}/common/lib">
258      <include name="*.jar"/>
259    </fileset>
260    <pathelement location="${catalina.home}/shared/classes"/>
261    <fileset dir="${catalina.home}/shared/lib">
262      <include name="*.jar"/>
263    </fileset>
264
265  </path>
266
267
268
269<!-- ==================== All Target ====================================== -->
270
271<!--
272
273  The "all" target is a shortcut for running the "clean" target followed
274  by the "compile" target, to force a complete recompile.
275
276-->
277
278  <target name="all" depends="clean,compile"
279   description="Clean build and dist directories, then compile"/>
280
281
282
283<!-- ==================== Clean Target ==================================== -->
284
285<!--
286
287  The "clean" target deletes any previous "build" and "dist" directory,
288  so that you can be ensured the application can be built from scratch.
289
290-->
291
292  <target name="clean"
293   description="Delete old build and dist directories">
294    <delete dir="${build.home}"/>
295    <delete dir="${dist.home}"/>
296  </target>
297
298
299
300<!-- ==================== Compile Target ================================== -->
301
302<!--
303
304  The "compile" target transforms source files (from your "src" directory)
305  into object files in the appropriate location in the build directory.
306  This example assumes that you will be including your classes in an
307  unpacked directory hierarchy under "/WEB-INF/classes".
308
309-->
310
311  <target name="compile" depends="prepare"
312   description="Compile Java sources">
313
314    <!-- Compile Java classes as necessary -->
315    <mkdir    dir="${build.home}/WEB-INF/classes"/>
316    <javac srcdir="${src.home}"
317          destdir="${build.home}/WEB-INF/classes"
318            debug="${compile.debug}"
319      deprecation="${compile.deprecation}"
320         optimize="${compile.optimize}">
321        <classpath refid="compile.classpath"/>
322    </javac>
323
324    <!-- Copy application resources -->
325    <copy  todir="${build.home}/WEB-INF/classes">
326      <fileset dir="${src.home}" excludes="**/*.java"/>
327    </copy>
328
329  </target>
330
331<!-- ==================== Deploy Target =================================== -->
332
333<!--
334
335  The "deploy" target copies the contents of the build directory into a
336  location required by our servlet container, and picks up any external
337  dependencies along the way.  AFter restarting the servlet container, you
338  can now test your web application.
339
340-->
341
342  <target name="deploy" depends="compile"
343   description="Deploy application to servlet container">
344
345    <!-- Copy the contents of the build directory -->
346    <mkdir     dir="${deploy.home}"/>
347    <copy    todir="${deploy.home}">
348      <fileset dir="${build.home}"/>
349    </copy>
350
351  </target>
352
353
354
355
356
357<!-- ==================== Dist Target ===================================== -->
358
359
360<!--
361
362  The "dist" target creates a binary distribution of your application
363  in a directory structure ready to be archived in a tar.gz or zip file.
364  Note that this target depends on two others:
365
366  * "compile" so that the entire web application (including external
367    dependencies) will have been assembled
368
369  * "javadoc" so that the application Javadocs will have been created
370
371-->
372
373  <target name="dist" depends="compile,javadoc"
374   description="Create binary distribution">
375
376    <!-- Copy documentation subdirectories -->
377    <mkdir dir="${dist.home}/docs"/>
378    <copy todir="${dist.home}/docs">
379      <fileset dir="${docs.home}"/>
380    </copy>
381
382    <!-- Create application JAR file -->
383    <jar jarfile="${dist.home}/${app.name}-${app.version}.war"
384         basedir="${build.home}"/>
385
386    <!-- Copy additional files to ${dist.home} as necessary -->
387
388  </target>
389
390
391
392<!-- ==================== Install Target ================================== -->
393
394<!--
395
396  The "install" target tells the specified Tomcat 4 installation to dynamically
397  install this web application and make it available for execution.  It does
398  *not* cause the existence of this web application to be remembered across
399  Tomcat restarts; if you restart the server, you will need to re-install all
400  this web application.
401
402  If you have already installed this application, and simply want Tomcat to
403  recognize that you have updated Java classes (or the web.xml file), use the
404  "reload" target instead.
405
406  NOTE:  This target will only succeed if it is run from the same server that
407  Tomcat is running on.
408
409  NOTE:  This is the logical opposite of the "remove" target.
410
411-->
412
413  <target name="install" depends="compile"
414   description="Install application to servlet container">
415    <install url="${manager.url}"
416        username="${manager.username}"
417        password="${manager.password}"
418            path="${app.path}"
419             war="file://${build.home}"/>
420
421  </target>
422
423
424<!-- ==================== Javadoc Target ================================== -->
425
426<!--
427
428  The "javadoc" target creates Javadoc API documentation for the Java
429  classes included in your application.  Normally, this is only required
430  when preparing a distribution release, but is available as a separate
431  target in case the developer wants to create Javadocs independently.
432
433-->
434
435  <target name="javadoc" depends="compile"
436   description="Create Javadoc API documentation">
437
438    <mkdir          dir="${dist.home}/docs/api"/>
439    <javadoc sourcepath="${src.home}"
440                destdir="${dist.home}/docs/api"
441           packagenames="*">
442      <classpath refid="compile.classpath"/>
443    </javadoc>
444
445  </target>
446
447
448
449<!-- ====================== List Target =================================== -->
450
451<!--
452
453  The "list" target asks the specified Tomcat 4 installation to list the
454  currently running web applications, either loaded at startup time or
455  installed dynamically.  It is useful to determine whether or not the
456  application you are currently developing has been installed.
457
458-->
459
460  <target name="list"
461   description="List installed applications on servlet container">
462
463    <list    url="${manager.url}"
464        username="${manager.username}"
465        password="${manager.password}"/>
466
467  </target>
468
469
470<!-- ==================== Prepare Target ================================== -->
471
472<!--
473
474  The "prepare" target is used to create the "build" destination directory,
475  and copy the static contents of your web application to it.  If you need
476  to copy static files from external dependencies, you can customize the
477  contents of this task.
478
479  Normally, this task is executed indirectly when needed.
480
481-->
482
483  <target name="prepare">
484
485    <!-- Create build directories as needed -->
486    <mkdir  dir="${build.home}"/>
487    <mkdir  dir="${build.home}/WEB-INF"/>
488    <mkdir  dir="${build.home}/WEB-INF/classes"/>
489
490
491    <!-- Copy static content of this web application -->
492    <copy todir="${build.home}">
493      <fileset dir="${web.home}"/>
494    </copy>
495
496    <!-- Copy external dependencies as required -->
497    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
498    <mkdir  dir="${build.home}/WEB-INF/lib"/>
499    <copy todir="${build.home}/WEB-INF/" file="${geni}"/>
500    <copy todir="${build.home}/WEB-INF/" file="${medsup.txt}"/>
501    <copy todir="${build.home}/WEB-INF/" file="${simple}"/>
502    <copy todir="${build.home}/WEB-INF/" file="${intersect}"/>
503    <copy todir="${build.home}/WEB-INF/" file="${rtml}"/>
504    <copy todir="${build.home}/WEB-INF/" file="${usn-rtml}"/>
505    <copy todir="${build.home}/WEB-INF/" file="${se-rtml}"/>
506    <copy todir="${build.home}/WEB-INF/" file="${sadmir-rtml}"/>
507    <copy todir="${build.home}/WEB-INF/" file="${rtml-xml}"/>
508    <copy todir="${build.home}/WEB-INF/lib" file="${abac.jar}"/>
509    <copy todir="${build.home}/WEB-INF/lib" file="${rbtm.jar}"/>
510    <copy todir="${build.home}/WEB-INF/lib" file="${rtml.jar}"/>
511    <copy todir="${build.home}/WEB-INF" file="${system.domain}"/>
512
513  </target>
514
515
516<!-- ==================== Reload Target =================================== -->
517
518<!--
519
520  The "reload" target tells the specified Tomcat 4 installation to dynamically
521  reload this web application, to reflect changes in the underlying classes or
522  the "web.xml" deployment descriptor.
523
524-->
525
526  <target name="reload" depends="compile,deploy"
527   description="Reload application on servlet container">
528
529    <reload url="${manager.url}"
530       username="${manager.username}"
531       password="${manager.password}"
532           path="${app.path}"/>
533
534  </target>
535
536
537<!-- ==================== Remove Target =================================== -->
538
539<!--
540
541  The "remove" target tells the specified Tomcat 4 installation to dynamically
542  remove this web application from service.
543
544  NOTE:  This is the logical opposite of the "install" target.
545
546-->
547
548  <target name="remove"
549   description="Remove application on servlet container">
550
551    <remove url="${manager.url}"
552       username="${manager.username}"
553       password="${manager.password}"
554           path="${app.path}"/>
555
556  </target>
557
558
559</project>
Note: See TracBrowser for help on using the repository browser.