Debian Codegraph @

util/buildscripts/webbuild/server/build.xml

raw symbols SCIP
1 <project name="dojoweb" default="compile" basedir=".">
2 <property file="build.properties"/>
3 <import file="${tomcat.home}/bin/catalina-tasks.xml"/>
4
5
6 <property name="app.name" value="dojoweb"/>
7 <property name="app.path" value="/${app.name}"/>
8 <property name="app.version" value="0.1-dev"/>
9 <property name="build.home" value="${basedir}/build"/>
10 <property name="dist.home" value="${basedir}/dist"/>
11 <property name="docs.home" value="${basedir}/docs"/>
12 <property name="src.home" value="${basedir}/src"/>
13 <property name="web.home" value="${basedir}/web"/>
14 <property name="lib.home" value="lib"/>
15 <property name="jslib.home" value="jslib"/>
16
17 <property name="compile.debug" value="true"/>
18 <property name="compile.deprecation" value="true"/>
19 <property name="compile.optimize" value="false"/>
20
21 <path id="compile.classpath">
22 <pathelement location="${tomcat.home}/lib/servlet-api.jar"/>
23 <pathelement location="${lib.home}/js.jar" />
24 <pathelement location="${lib.home}/shinksafe.jar" />
25 </path>
26
27
28 <!-- ==================== All Target ==================================== -->
29 <target name="all" depends="clean,compile" description="Clean build and dist directories, then compile"/>
30
31 <!-- ==================== Clean Target ==================================== -->
32 <target name="clean" description="Delete old build and dist directories">
33 <delete dir="${build.home}"/>
34 <delete dir="${dist.home}"/>
35 </target>
36
37 <!-- ==================== Prepare Target ================================== -->
38 <target name="prepare">
39 <!-- Create build directories as needed -->
40 <mkdir dir="${build.home}"/>
41 <mkdir dir="${build.home}/WEB-INF"/>
42 <mkdir dir="${build.home}/WEB-INF/classes"/>
43
44
45 <!-- Copy static content of this web application -->
46 <copy todir="${build.home}">
47 <fileset dir="${web.home}"/>
48 </copy>
49
50 <!-- Copy external dependencies as required -->
51 <mkdir dir="${build.home}/WEB-INF/lib"/>
52 <copy todir="${build.home}/WEB-INF/lib">
53 <fileset dir="${lib.home}"/>
54 </copy>
55 </target>
56
57 <!-- ==================== Compile Target ================================== -->
58 <target name="compile" depends="prepare" description="Compile Java sources">
59
60 <!-- Compile Java classes as necessary -->
61 <mkdir dir="${build.home}/WEB-INF/classes"/>
62 <javac srcdir="${src.home}"
63 destdir="${build.home}/WEB-INF/classes"
64 debug="${compile.debug}"
65 deprecation="${compile.deprecation}"
66 optimize="${compile.optimize}">
67 <classpath refid="compile.classpath"/>
68 </javac>
69
70 <!-- Copy application resources -->
71 <copy todir="${build.home}/WEB-INF/classes">
72 <fileset dir="${src.home}" excludes="**/*.java"/>
73 </copy>
74
75 </target>
76
77 <!-- ==================== Dist Target ===================================== -->
78 <target name="dist" depends="compile,javadoc" description="Create binary distribution">
79 <!-- Copy documentation subdirectories -->
80 <!-- mkdir dir="${dist.home}/docs"/>
81 <copy todir="${dist.home}/docs">
82 <fileset dir="${docs.home}"/>
83 </copy -->
84
85 <!-- Create application JAR file -->
86 <jar jarfile="${dist.home}/${app.name}-${app.version}.war" basedir="${build.home}"/>
87 </target>
88
89 <!-- ==================== Install Target ================================== -->
90 <!--
91
92 The "install" target tells the specified Tomcat 6 installation to dynamically
93 install this web application and make it available for execution. It does
94 *not* cause the existence of this web application to be remembered across
95 Tomcat restarts; if you restart the server, you will need to re-install all
96 this web application.
97
98 If you have already installed this application, and simply want Tomcat to
99 recognize that you have updated Java classes (or the web.xml file), use the
100 "reload" target instead.
101
102 NOTE: This target will only succeed if it is run from the same server that
103 Tomcat is running on.
104
105 NOTE: This is the logical opposite of the "remove" target.
106
107 -->
108 <target name="install" depends="compile" description="Install application to servlet container">
109 <deploy url="${manager.url}"
110 username="${manager.username}"
111 password="${manager.password}"
112 path="${app.path}"
113 localWar="file://${build.home}"/>
114 </target>
115
116
117 <!-- ==================== Javadoc Target ================================== -->
118 <!--
119
120 The "javadoc" target creates Javadoc API documentation for the Java
121 classes included in your application. Normally, this is only required
122 when preparing a distribution release, but is available as a separate
123 target in case the developer wants to create Javadocs independently.
124
125 -->
126 <target name="javadoc" depends="compile" description="Create Javadoc API documentation">
127 <mkdir dir="${dist.home}/docs/api"/>
128 <javadoc sourcepath="${src.home}"
129 destdir="${dist.home}/docs/api"
130 packagenames="*">
131 <classpath refid="compile.classpath"/>
132 </javadoc>
133 </target>
134
135 <!-- ==================== Reload Target =================================== -->
136 <!--
137
138 The "reload" signals the specified application Tomcat 6 to shut itself down
139 and reload. This can be useful when the web application context is not
140 reloadable and you have updated classes or property files in the
141 /WEB-INF/classes directory or when you have added or updated jar files in the
142 /WEB-INF/lib directory.
143
144 NOTE: The /WEB-INF/web.xml web application configuration file is not reread
145 on a reload. If you have made changes to your web.xml file you must stop
146 then start the web application.
147
148 -->
149 <target name="reload" depends="compile" description="Reload application on servlet container">
150
151 <reload url="${manager.url}"
152 username="${manager.username}"
153 password="${manager.password}"
154 path="${app.path}"/>
155 </target>
156
157 <!-- ==================== Remove Target =================================== -->
158 <!--
159
160 The "remove" target tells the specified Tomcat 6 installation to dynamically
161 remove this web application from service.
162
163 NOTE: This is the logical opposite of the "install" target.
164
165 -->
166 <target name="remove" description="Remove application on servlet container">
167 <undeploy url="${manager.url}"
168 username="${manager.username}"
169 password="${manager.password}"
170 path="${app.path}"/>
171 </target>
172 </project>