build.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <copy todir="${build.dir}">
  66. <fileset dir="${src.dir}">
  67. <include name="*.properties"/>
  68. </fileset>
  69. </copy>
  70. </target>
  71. <target name="format" description="Formats all project source code">
  72. <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
  73. <classpath refid="jalopy-classpath"/>
  74. </taskdef>
  75. <jalopy fileformat="unix"
  76. convention="${jalopy.xml}"
  77. history="file"
  78. historymethod="adler32"
  79. loglevel="error"
  80. threads="2"
  81. classpathref="qa-portalpath">
  82. <fileset dir="${src.dir}">
  83. <include name="**/*.java"/>
  84. </fileset>
  85. </jalopy>
  86. </target>
  87. <target name="warfile" depends="build" description="Build the web application archives">
  88. <mkdir dir="${dist.dir}"/>
  89. <delete file="${dist.dir}/${name}.war"/>
  90. <war warfile="${dist.dir}/${name}.war" webxml="${war.dir}/WEB-INF/web.xml">
  91. <!-- Include the JSPs and other documents -->
  92. <fileset dir="war" excludes="WEB-INF/**"/>
  93. <!-- Bring in Spring-specific XML configuration files -->
  94. <webinf dir="${war.dir}/WEB-INF">
  95. <!-- We separately include these -->
  96. <exclude name="web.xml"/>
  97. </webinf>
  98. <!-- Include the compiled classes -->
  99. <classes dir="${build.dir}"/>
  100. <!-- Include required libraries -->
  101. <lib dir="${lib.dir}/jakarta-commons" includes="*.jar" excludes="*logging*"/>
  102. <lib dir="${lib.dir}/jakarta-taglibs" includes="*.jar"/>
  103. <lib dir="${lib.dir}/hsqldb" includes="*.jar"/>
  104. <lib dir="${lib.dir}/j2ee" includes="jstl.jar"/>
  105. <lib dir="${dist.lib.dir}" includes="acegi-security-taglib.jar"/>
  106. </war>
  107. </target>
  108. <target name="javadoc" description="Generate Javadocs.">
  109. <mkdir dir="${javadocs.dir}"/>
  110. <javadoc sourcepath="src" destdir="${javadocs.dir}" windowtitle="Contact Sample Application"
  111. defaultexcludes="yes" author="true" version="true" use="true">
  112. <doctitle><![CDATA[<h1>Acegi Security System for Spring Contacts Sample</h1>]]></doctitle>
  113. <bottom><![CDATA[<A HREF="http://acegisecurity.sourceforge.net">Acegi Security System for Spring Project]]></bottom>
  114. <classpath refid="qa-portalpath"/>
  115. <packageset dir="${src.dir}">
  116. <include name="sample/contact/**"/>
  117. </packageset>
  118. </javadoc>
  119. </target>
  120. <target name="release" depends="clean,warfile,javadoc" description="Builds a clean release file"/>
  121. </project>