build.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?xml version="1.0"?>
  2. <!--
  3. Build file for the "contacts" sample application.
  4. $Id$
  5. -->
  6. <project name="contacts-sample" basedir="." default="usage">
  7. <property file="build.properties"/>
  8. <property file="project.properties"/>
  9. <path id="qa-portalpath">
  10. <fileset dir="${dist.lib.dir}">
  11. <include name="acegi-security.jar"/>
  12. </fileset>
  13. <fileset dir="${lib.dir}">
  14. <include name="**/**.jar"/>
  15. </fileset>
  16. </path>
  17. <path id="jalopy-classpath">
  18. <fileset dir="${lib.dir}/jalopy">
  19. <include name="**/*.jar"/>
  20. </fileset>
  21. </path>
  22. <target name="usage">
  23. <echo message=""/>
  24. <echo message="Contacts sample application build file"/>
  25. <echo message="*** Make sure you've followed the instructions for your container in the reference documentation."/>
  26. <echo message="------------------------------------------------------"/>
  27. <echo message=""/>
  28. <echo message="Available targets are:"/>
  29. <echo message=""/>
  30. <echo message="clean --> Clean output dirs"/>
  31. <echo message="build --> Compile main Java sources and copy libraries"/>
  32. <echo message="warfile --> Create WAR deployment units"/>
  33. <echo message="javadoc --> Create API documentation"/>
  34. <echo message=""/>
  35. </target>
  36. <target name="clean" description="Clean output dirs (build, dist)">
  37. <delete dir="${build.dir}"/>
  38. <delete dir="${dist.dir}"/>
  39. <delete dir="${war.dir}/WEB-INF/lib"/>
  40. </target>
  41. <target name="build" description="Compile main source tree java files into class files">
  42. <mkdir dir="${build.dir}"/>
  43. <javac destdir="${build.dir}" target="1.3" debug="true" deprecation="false"
  44. optimize="false" failonerror="true">
  45. <src path="${src.dir}"/>
  46. <classpath refid="qa-portalpath"/>
  47. </javac>
  48. <copy todir="${build.dir}">
  49. <fileset dir="${src.dir}">
  50. <include name="*.properties"/>
  51. </fileset>
  52. </copy>
  53. </target>
  54. <target name="format" description="Formats all project source code">
  55. <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
  56. <classpath refid="jalopy-classpath"/>
  57. </taskdef>
  58. <jalopy fileformat="unix"
  59. convention="${jalopy.xml}"
  60. history="file"
  61. historymethod="adler32"
  62. loglevel="error"
  63. threads="2"
  64. classpathref="qa-portalpath">
  65. <fileset dir="${src.dir}">
  66. <include name="**/*.java"/>
  67. </fileset>
  68. </jalopy>
  69. </target>
  70. <target name="warfile" depends="build" description="Build the web application archives">
  71. <mkdir dir="${dist.dir}"/>
  72. <delete file="${dist.dir}/${name}.war"/>
  73. <war warfile="${dist.dir}/${name}.war" webxml="${war.dir}/WEB-INF/web.xml">
  74. <!-- Include the JSPs and other documents -->
  75. <fileset dir="war" excludes="WEB-INF/**"/>
  76. <!-- Bring in Spring-specific XML configuration files -->
  77. <webinf dir="${war.dir}/WEB-INF">
  78. <!-- We separately include these -->
  79. <exclude name="web.xml"/>
  80. </webinf>
  81. <!-- Include the compiled classes -->
  82. <classes dir="${build.dir}"/>
  83. <!-- Include required libraries -->
  84. <lib dir="${lib.dir}/jakarta-commons" includes="*.jar" excludes="*logging*"/>
  85. <lib dir="${lib.dir}/jakarta-taglibs" includes="*.jar"/>
  86. <lib dir="${lib.dir}/hsqldb" includes="*.jar"/>
  87. <lib dir="${lib.dir}/j2ee" includes="jstl.jar"/>
  88. <lib dir="${dist.lib.dir}" includes="acegi-security-taglib.jar"/>
  89. </war>
  90. </target>
  91. <target name="javadoc" description="Generate Javadocs.">
  92. <mkdir dir="${javadocs.dir}"/>
  93. <javadoc sourcepath="src" destdir="${javadocs.dir}" windowtitle="Contact Sample Application"
  94. defaultexcludes="yes" author="true" version="true" use="true">
  95. <doctitle><![CDATA[<h1>Acegi Security System for Spring Contacts Sample</h1>]]></doctitle>
  96. <bottom><![CDATA[<A HREF="http://acegisecurity.sourceforge.net">Acegi Security System for Spring Project]]></bottom>
  97. <classpath refid="qa-portalpath"/>
  98. <packageset dir="${src.dir}">
  99. <include name="sample/contact/**"/>
  100. </packageset>
  101. </javadoc>
  102. </target>
  103. <target name="release" depends="clean,warfile,javadoc" description="Builds a clean release file"/>
  104. </project>