build.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0"?>
  2. <!--
  3. Build file for the "contacts" sample application.
  4. $Id$
  5. -->
  6. <project name="minimal" 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 copied the required JAR files to the lib directory."/>
  26. <echo message="*** See lib/readme.txt for more information."/>
  27. <echo message="------------------------------------------------------"/>
  28. <echo message=""/>
  29. <echo message="Available targets are:"/>
  30. <echo message=""/>
  31. <echo message="clean --> Clean output dirs"/>
  32. <echo message="build --> Compile main Java sources and copy libraries"/>
  33. <echo message="warfile --> Create WAR deployment units"/>
  34. <echo message="javadoc --> Create API documentation"/>
  35. <echo message=""/>
  36. </target>
  37. <target name="clean" description="Clean output dirs (build, dist)">
  38. <delete dir="${build.dir}"/>
  39. <delete dir="${dist.dir}"/>
  40. <delete dir="${war.dir}/WEB-INF/lib"/>
  41. </target>
  42. <target name="build" description="Compile main source tree java files into class files">
  43. <mkdir dir="${build.dir}"/>
  44. <javac destdir="${build.dir}" target="1.3" debug="true" deprecation="false"
  45. optimize="false" failonerror="true">
  46. <src path="${src.dir}"/>
  47. <classpath refid="qa-portalpath"/>
  48. </javac>
  49. <copy todir="${build.dir}">
  50. <fileset dir="${src.dir}">
  51. <include name="*.properties"/>
  52. </fileset>
  53. </copy>
  54. </target>
  55. <target name="format" description="Formats all project source code">
  56. <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
  57. <classpath refid="jalopy-classpath"/>
  58. </taskdef>
  59. <jalopy fileformat="unix"
  60. convention="${jalopy.xml}"
  61. history="file"
  62. historymethod="adler32"
  63. loglevel="error"
  64. threads="2"
  65. classpathref="qa-portalpath">
  66. <fileset dir="${src.dir}">
  67. <include name="**/*.java"/>
  68. </fileset>
  69. </jalopy>
  70. </target>
  71. <target name="warfile" depends="build" description="Build the web application archives">
  72. <mkdir dir="${dist.dir}"/>
  73. <!-- Temporary staging directory for libs -->
  74. <delete dir="${war.dir}/WEB-INF/lib"/>
  75. <mkdir dir="${war.dir}/WEB-INF/lib"/>
  76. <!-- Copy required libs into temporary staging directory -->
  77. <copy todir="${war.dir}/WEB-INF/lib">
  78. <fileset dir="${lib.dir}/jakarta-taglibs">
  79. <include name="standard.jar"/>
  80. </fileset>
  81. <fileset dir="${lib.dir}/j2ee">
  82. <include name="jstl.jar"/>
  83. </fileset>
  84. </copy>
  85. <war warfile="${dist.dir}/${name}.war" webxml="${war.dir}/WEB-INF/web.xml">
  86. <!-- Include the JSPs and other documents -->
  87. <fileset dir="war" excludes="WEB-INF/**"/>
  88. <!-- Bring in Spring-specific XML configuration files -->
  89. <webinf dir="${war.dir}/WEB-INF">
  90. <!-- We separately include these -->
  91. <exclude name="web.xml"/>
  92. <exclude name="lib/**"/>
  93. </webinf>
  94. <!-- Include the compiled classes -->
  95. <classes dir="${build.dir}"/>
  96. <!-- Include the temporary staging directory for libs -->
  97. <lib dir = "${war.dir}/WEB-INF/lib"/>
  98. </war>
  99. <!-- Remove temporary staging directory -->
  100. <delete dir="${war.dir}/WEB-INF/lib"/>
  101. </target>
  102. <target name="javadoc" description="Generate Javadocs.">
  103. <mkdir dir="${javadocs.dir}"/>
  104. <javadoc sourcepath="src" destdir="${javadocs.dir}" windowtitle="Contact Sample Application"
  105. defaultexcludes="yes" author="true" version="true" use="true">
  106. <doctitle><![CDATA[<h1>Acegi Security System for Spring Contacts Sample</h1>]]></doctitle>
  107. <bottom><![CDATA[<A HREF="http://acegisecurity.sourceforge.net">Acegi Security System for Spring Project]]></bottom>
  108. <classpath refid="qa-portalpath"/>
  109. <packageset dir="${src.dir}">
  110. <include name="sample/contact/**"/>
  111. </packageset>
  112. </javadoc>
  113. </target>
  114. <target name="release" depends="clean,warfile,javadoc" description="Builds a clean release file"/>
  115. </project>