build.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?xml version="1.0"?>
  2. <!--
  3. * Copyright 2004 Acegi Technology Pty Limited
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. *
  18. * $Id$
  19. -->
  20. <!--
  21. Build file for the "contacts" sample application.
  22. -->
  23. <project name="contacts-sample" basedir="." default="usage">
  24. <property file="build.properties"/>
  25. <property file="project.properties"/>
  26. <path id="qa-portalpath">
  27. <fileset dir="${dist.lib.dir}">
  28. <include name="acegi-security.jar"/>
  29. </fileset>
  30. <fileset dir="${lib.dir}">
  31. <include name="**/**.jar"/>
  32. </fileset>
  33. </path>
  34. <path id="jalopy-classpath">
  35. <fileset dir="${lib.dir}/jalopy">
  36. <include name="**/*.jar"/>
  37. </fileset>
  38. </path>
  39. <target name="usage">
  40. <echo message=""/>
  41. <echo message="Contacts sample application build file"/>
  42. <echo message="*** Make sure you've followed the instructions for your container in the reference documentation."/>
  43. <echo message="------------------------------------------------------"/>
  44. <echo message=""/>
  45. <echo message="Available targets are:"/>
  46. <echo message=""/>
  47. <echo message="clean --> Clean output dirs"/>
  48. <echo message="build --> Compile main Java sources and copy libraries"/>
  49. <echo message="warfile --> Create WAR deployment units"/>
  50. <echo message="javadoc --> Create API documentation"/>
  51. <echo message=""/>
  52. </target>
  53. <target name="clean" description="Clean output dirs (build, dist)">
  54. <delete dir="${build.dir}"/>
  55. <delete dir="${dist.dir}"/>
  56. <delete dir="${war.dir}/WEB-INF/lib"/>
  57. </target>
  58. <target name="build" description="Compile main source tree java files into class files">
  59. <mkdir dir="${build.dir}"/>
  60. <javac destdir="${build.dir}" target="1.3" debug="true" deprecation="false"
  61. optimize="false" failonerror="true">
  62. <src path="${src.dir}"/>
  63. <classpath refid="qa-portalpath"/>
  64. </javac>
  65. <jar jarfile="${client.dir}/contacts.jar">
  66. <fileset dir="${build.dir}">
  67. <include name="sample/contact/Contact.class"/>
  68. <include name="sample/contact/ContactManager.class"/>
  69. <include name="sample/contact/ClientApplication.class"/>
  70. </fileset>
  71. </jar>
  72. </target>
  73. <target name="format" description="Formats all project source code">
  74. <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
  75. <classpath refid="jalopy-classpath"/>
  76. </taskdef>
  77. <jalopy fileformat="unix"
  78. convention="${jalopy.xml}"
  79. history="file"
  80. historymethod="adler32"
  81. loglevel="error"
  82. threads="2"
  83. classpathref="qa-portalpath">
  84. <fileset dir="${src.dir}">
  85. <include name="**/*.java"/>
  86. </fileset>
  87. </jalopy>
  88. </target>
  89. <target name="warfile" depends="build" description="Build the web application archives">
  90. <mkdir dir="${dist.dir}"/>
  91. <delete dir="${tmp.dir}"/>
  92. <!-- Make WAR suitable for deployment into containers WITHOUT container adapters -->
  93. <delete file="${dist.dir}/${name.filter}.war"/>
  94. <mkdir dir="${tmp.dir}/${name.filter}"/>
  95. <copy todir="${tmp.dir}/${name.filter}">
  96. <fileset dir="${war.dir}">
  97. <include name="**"/>
  98. </fileset>
  99. <fileset dir="${etc.dir}/filter">
  100. <include name="acegilogin.jsp"/>
  101. </fileset>
  102. </copy>
  103. <copy todir="${tmp.dir}/${name.filter}/classes">
  104. <fileset dir="${build.dir}">
  105. <include name="**"/>
  106. </fileset>
  107. </copy>
  108. <copy todir="${tmp.dir}/${name.filter}/WEB-INF">
  109. <fileset dir="${etc.dir}/filter">
  110. <include name="web.xml"/>
  111. <include name="applicationContext.xml"/>
  112. </fileset>
  113. </copy>
  114. <war warfile="${dist.dir}/${name.filter}.war" webxml="${tmp.dir}/${name.filter}/WEB-INF/web.xml">
  115. <!-- Include the files which are not under WEB-INF -->
  116. <fileset dir="${tmp.dir}/${name.filter}">
  117. <exclude name="WEB-INF/**"/>
  118. <exclude name="classes/**"/>
  119. </fileset>
  120. <!-- Bring in various XML configuration files -->
  121. <webinf dir="${tmp.dir}/${name.filter}/WEB-INF">
  122. <exclude name="web.xml"/>
  123. </webinf>
  124. <!-- Include the compiled classes -->
  125. <classes dir="${tmp.dir}/${name.filter}/classes"/>
  126. <!-- Include required libraries -->
  127. <lib dir="${lib.dir}/jakarta-taglibs" includes="*.jar"/>
  128. <lib dir="${lib.dir}/spring" includes="spring.jar"/>
  129. <lib dir="${lib.dir}/aop-alliance" includes="aopalliance.jar"/>
  130. <lib dir="${lib.dir}/regexp" includes="jakarta-oro.jar"/>
  131. <lib dir="${lib.dir}/j2ee" includes="jstl.jar"/>
  132. <lib dir="${lib.dir}/caucho" includes="*.jar"/>
  133. <lib dir="${lib.dir}/jakarta-commons" includes="commons-codec.jar"/>
  134. <lib dir="${dist.lib.dir}" includes="acegi-security-taglib.jar"/>
  135. <lib dir="${dist.lib.dir}" includes="acegi-security.jar"/>
  136. </war>
  137. <!-- Make WAR suitable for deployment into containers WITH container adapters -->
  138. <delete file="${dist.dir}/${name.ca}.war"/>
  139. <mkdir dir="${tmp.dir}/${name.ca}"/>
  140. <copy todir="${tmp.dir}/${name.ca}">
  141. <fileset dir="${war.dir}">
  142. <include name="**"/>
  143. </fileset>
  144. <fileset dir="${etc.dir}/ca">
  145. <include name="login.jsp"/>
  146. </fileset>
  147. </copy>
  148. <copy todir="${tmp.dir}/${name.ca}/classes">
  149. <fileset dir="${build.dir}">
  150. <include name="**"/>
  151. </fileset>
  152. <fileset dir="${etc.dir}/ca">
  153. <include name="resin-acegisecurity.xml"/>
  154. </fileset>
  155. </copy>
  156. <copy todir="${tmp.dir}/${name.ca}/WEB-INF">
  157. <fileset dir="${etc.dir}/ca">
  158. <include name="jboss-web.xml"/>
  159. <include name="resin-web.xml"/>
  160. <include name="web.xml"/>
  161. <include name="applicationContext.xml"/>
  162. </fileset>
  163. </copy>
  164. <war warfile="${dist.dir}/${name.ca}.war" webxml="${tmp.dir}/${name.ca}/WEB-INF/web.xml">
  165. <!-- Include the files which are not under WEB-INF -->
  166. <fileset dir="${tmp.dir}/${name.ca}">
  167. <exclude name="WEB-INF/**"/>
  168. <exclude name="classes/**"/>
  169. </fileset>
  170. <!-- Bring in various XML configuration files -->
  171. <webinf dir="${tmp.dir}/${name.ca}/WEB-INF">
  172. <exclude name="web.xml"/>
  173. </webinf>
  174. <!-- Include the compiled classes -->
  175. <classes dir="${tmp.dir}/${name.ca}/classes"/>
  176. <!-- Include required libraries -->
  177. <lib dir="${lib.dir}/jakarta-taglibs" includes="*.jar"/>
  178. <lib dir="${lib.dir}/j2ee" includes="jstl.jar"/>
  179. <lib dir="${dist.lib.dir}" includes="acegi-security-taglib.jar"/>
  180. </war>
  181. </target>
  182. <target name="javadoc" description="Generate Javadocs.">
  183. <mkdir dir="${javadocs.dir}"/>
  184. <javadoc sourcepath="src" destdir="${javadocs.dir}" windowtitle="Contact Sample Application"
  185. defaultexcludes="yes" author="true" version="true" use="true">
  186. <doctitle><![CDATA[<h1>Acegi Security System for Spring Contacts Sample</h1>]]></doctitle>
  187. <bottom><![CDATA[<A HREF="http://acegisecurity.sourceforge.net">Acegi Security System for Spring Project]]></bottom>
  188. <classpath refid="qa-portalpath"/>
  189. <packageset dir="${src.dir}">
  190. <include name="sample/contact/**"/>
  191. </packageset>
  192. </javadoc>
  193. </target>
  194. <target name="release" depends="clean,warfile,javadoc" description="Builds a clean release file"/>
  195. </project>