root/trunk/calendar3/bldfiles/buildsh.xml

Revision 293 (checked in by douglm, 7 years ago)

Fixes needed to resolve properties issues when applications are bundled together.

The result of bundling the applications is that the properties files are all on the same class path. This means that we cannot have one resource file per application, rather it's shared between all of them.

Rather than have client specific properties be based on a particular properties file they are now based on the context paramater bwappname. This is used to create a property name prefix which is then used to get client specific properties.

There is an additional section in the config/configs/democal.properties file which defiens the names and associated type of application.

Most application properties have changed and a few have been added. Watch out for the additonal properties

# uris to cross link apps - of dubious usefulness
org.bedework.global.public.admin.uri=/caladmin
org.bedework.global.public.calendar.uri=/cal
org.bedework.global.personal.calendar.uri=/ucal

Additional properties have also been added to each application section - <app-prefix> refers to the application specific part of the name, e.g. org.bedework.app.Caladmin

<app-prefix>.logprefix= value used for log messages
<app-prefix>.guestmode= true for config, public events client and public caldav, false elsewhere
<app-prefix>.publicadmin= true for public events admin client, false elsewhere
<app-prefix>.run.as.user= only present for pubcaldav(?), public events admin and public events client.

Created a new ant task to cycle through the above list of applications. Also made use of the ant propertyset task.

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================================================================
4      This file builds a runnable application wrapped up as a zip file.
5      Unpacking the zip shoudl result in a directory containing a shell
6      script, a set of jars and any other resources needed.
7
8      Properties we need:
9        app.core.env.pname     core properties source
10        app.run.shellscr       location of the skeleton shell script.
11        app.run.jar.file       application jar file
12        app.run.main.class     main class for application.
13
14      Authors: Mike Douglass   douglm@rpi.edu
15      =================================================================== -->
16
17 <project name="uwcal.buildsh" default="build">
18   <target name="init">
19     <!-- Destinations - where we build stuff -->
20     <property name="app.dest.home"
21               location="${org.bedework.temp.shellscr.home}/${propval.app.zip.name}" />
22     <property name="app.dest.lib"
23               location="${app.dest.home}/lib" />
24     <property name="app.dest.classes"
25               location="${app.dest.home}/classes" />
26     <property name="app.dest.properties"
27               location="${app.dest.classes}/properties/calendar" />
28     <property name="app.dest.resources"
29               location="${app.dest.home}/resources" />
30
31     <property name="app.zip.file"
32               location="${dist.home}/${propval.app.zip.name}.zip" />
33   </target>
34
35   <!-- ================================================================
36        build target
37        ================================================================ -->
38
39   <target name="build" depends="init">
40     <filterset id="property.filters" >
41       <filter token="HIBERNATE-DIALECT"
42               value="${org.bedework.global.hibernate.dialect}" />
43
44       <filter token="DIRECTORY-BROWSING-DISALLOWED"
45               value="${org.bedework.global.directory.browsing.disallowed}" />
46
47       <filter token="APP-DESCRIPTION"
48               value="${propval.app.description}" />
49
50       <filter token="DUMP-CLASS"
51               value="org.bedework.tools.dumprestore.dump.Dump"/>
52       <filter token="RESTORE-CLASS"
53               value="org.bedework.tools.dumprestore.restore.Restore"/>
54
55       <filter token="APP-NAME"
56               value="${propval.app.name}"/>
57       <filter token="APP-VERSION"
58               value="${propval.app.version}"/>
59     </filterset>
60
61     <delete dir="${app.dest.home}" />
62
63     <!-- Library stuff -->
64
65     <mkdir dir="${app.dest.lib}" />
66
67     <!-- core files -->
68     <copy todir="${app.dest.lib}" flatten="yes" >
69       <fileset dir="${org.bedework.temp.jars}">
70         <include name="*.jar"/>
71       </fileset>
72       <fileset dir="${hibernate.jars.dir}">
73         <include name="*.jar"/>
74       </fileset>
75       <fileset dir="${digester.dir}">
76         <include name="*.jar"/>
77       </fileset>
78       <fileset dir="${struts.dir}">
79         <include name="*.jar"/>
80       </fileset>
81     </copy>
82
83     <!-- Some more standard libs -->
84     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
85     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
86
87     <!-- Extra libraries specified in calling build file -->
88     <copy todir="${app.dest.lib}" flatten="yes" >
89       <fileset refid="org.bedework.run.jars" />
90     </copy>
91     <copy todir="${app.dest.lib}" flatten="yes" >
92       <fileset refid="org.bedework.run.lib.jars" />
93     </copy>
94
95     <copy todir="${app.dest.classes}"  >
96       <fileset refid="org.bedework.extra.resources" />
97     </copy>
98
99     <!-- add the jdbcdriver if defined -->
100     <antcall target="add.jdbcdriver" inheritRefs="true" />
101
102     <!-- Create the env.properties file -->
103     <mkdir dir="${app.dest.properties}" />
104
105     <copy tofile="${app.dest.properties}/env.properties"
106           file="${org.bedework.config.properties}" />
107
108     <!-- ===============================================================
109                        Add any resource files
110          =============================================================== -->
111
112     <copy tofile="${app.dest.resources}/log4j.xml"
113           file="${org.bedework.runsh.log4j.xml}"
114           failonerror="false" />
115
116     <!-- ===============================================================
117                        Build the classpath
118          =============================================================== -->
119
120     <path id="app.run.path">
121       <fileset dir="${app.dest.lib}">
122         <include name="*.jar"/>
123       </fileset>
124       <pathelement location="${app.dest.resources}" />
125     </path>
126     <pathconvert property="app.run.cp" refid="app.run.path"
127                  targetos="unix" >
128       <map from="${app.dest.lib}" to="./lib"/>
129       <map from="${app.dest.resources}" to="./resources"/>
130     </pathconvert>
131
132     <!-- ===============================================================
133                        Copy and modify the shell script
134          =============================================================== -->
135
136     <copy toDir="${app.dest.home}"
137           file="${app.run.shellscr}" >
138       <filterset>
139         <filter token="CP"
140                 value=".:./classes:${app.run.cp}"/>
141       </filterset>
142       <filterset refid="property.filters" />
143     </copy>
144
145     <!-- build the zip file -->
146     <mkdir dir="${dist.home}" />
147     <delete file="${app.zip.file}" />
148
149     <zip destfile="${app.zip.file}" >
150       <zipfileset prefix="${propval.app.zip.name}" dir="${app.dest.home}" />
151     </zip>
152   </target>
153
154   <target name="add.jdbcdriver" if="propval.app.jdbcdriver.jar">
155     <copy todir="${app.dest.lib}" file="${propval.app.jdbcdriver.jar}"/>
156   </target>
157 </project>
158
Note: See TracBrowser for help on using the browser.