/plugins/JUnitPlugin/tags/release_0_5/JUnitPlugin/build.xml

#
XML | 206 lines | 107 code | 22 blank | 77 comment | 0 complexity | 8488660a12bb8a2807fd29e87c8821ec MD5 | raw file
  1. <?xml version="1.0"?>
  2. <!-- :tabSize=2:indentSize=2:noTabs=false: -->
  3. <!-- :folding=explicit:collapseFolds=1: -->
  4. <!--
  5. This is the standard build.xml file for building a jEdit plugin.
  6. The 'dist' target compiles the plugin, generates documentation, and creates
  7. the JAR file. Before running the 'dist' target, you will need to choose
  8. whether to generate the documentation using one of these two targets:
  9. - 'docs-xsltproc': Creates documentation using the xsltproc tool from
  10. libxslt, available at http://xmlsoft.org/XSLT
  11. - 'docs-xalan': Creates documentation using the Xalan XSLT processor,
  12. available at http://xml.apache.org/
  13. The default processor is xsltproc. You can change the processor to Xalan by
  14. setting the 'docs-proc.target' property to xalan. This can be done on the
  15. command line by adding '-Ddocs-proc.target=xalan' or in any of the
  16. build.properties files that are imported. If you do not have any
  17. documentation, set the 'build-docs.not-required' property to any value and
  18. the 'docs' target will be skipped.
  19. To use this template for building your own plugin, make these changes:
  20. - Change 'name' property for the <project> to the name of your plugin
  21. - Change definition of 'jedit.install.dir' to point to the directory
  22. containing jedit.jar
  23. - If necessary, add any dependencies to the 'project.class.path' definition
  24. - If necessary, change the list of files in the 'dist' target
  25. All properties specified in this build.xml can be overridden by properties
  26. file in the following locations:
  27. - ${base.dir}/build.properties : Specify properties that are to affect this
  28. project only.
  29. - ../build.properties : If building from CVS, this file comes in handy
  30. because it allows you to specify properties that affect all plugins.
  31. - ${user.home}/.build.properties : Allows you to specify global properties
  32. that are to be shared across all Ant projects. This file is hidden by
  33. unix file standard.
  34. - ${user.home}/.build.properties : Allows you to specify global properties
  35. that are to be shared across all Ant projects.
  36. When the same property is specified across the different properties file,
  37. the following precendence order applies - ${base.dir}/bulid.properties ->
  38. ../build.properties -> ${user.home}/.build.properties ->
  39. ${user.home}/build.properties.
  40. -->
  41. <project name="JUnitPlugin" default="dist" basedir=".">
  42. <!-- {{{ Properties -->
  43. <property file="build.properties"/>
  44. <property file="../build.properties"/>
  45. <property file="${user.home}/.build.properties"/>
  46. <property file="${user.home}/build.properties"/>
  47. <property name="jar.name" value="${ant.project.name}.jar"/>
  48. <property name="docs-proc.target" value="xsltproc"/>
  49. <property name="docbook.xsl" value="${docbook.xsl}"/>
  50. <property name="src.dir" value="."/>
  51. <property name="install.dir" value="${jedit.install.dir}/jars"/>
  52. <property name="build.dir" value="build"/>
  53. <property name="compiler.deprecation" value="true"/>
  54. <property name="compiler.optimize" value="false"/>
  55. <property name="compiler.verbose" value="false"/>
  56. <property name="compiler.debug" value="true"/>
  57. <property name="junit.jar" value="${install.dir}/junit.jar"/>
  58. <property name="ProjectViewer.jar" value="${install.dir}/ProjectViewer.jar"/>
  59. <!-- }}} -->
  60. <!-- {{{ Patterns -->
  61. <!--
  62. Put patterns here that should be included in the plugin jar from
  63. the source directory.
  64. -->
  65. <patternset id="include-from-source">
  66. <include name="dockables.xml"/>
  67. <include name="actions.xml"/>
  68. <include name="docs/**/*.*"/>
  69. <include name="**/*.properties"/>
  70. <include name="**/*.props"/>
  71. <include name="**/*.gif"/>
  72. <include name="**/*.png"/>
  73. </patternset>
  74. <!-- }}} -->
  75. <!-- {{{ Paths -->
  76. <path id="project.class.path">
  77. <pathelement location="${jedit.install.dir}/jedit.jar"/>
  78. <pathelement location="${CommonControls.jar}"/>
  79. <pathelement location="${ProjectViewer.jar}"/>
  80. <pathelement location="${junit.jar}"/>
  81. <pathelement location="${src.dir}"/>
  82. </path>
  83. <!-- }}} -->
  84. <!-- {{{ Targets -->
  85. <!-- {{{ 'init' target -->
  86. <target name="init" description="Initializes this project">
  87. <mkdir dir="${build.dir}"/>
  88. <delete file="docbook-wrapper.xsl" />
  89. <echo file="docbook-wrapper.xsl"
  90. message="&lt;xsl:stylesheet"/>
  91. <echo file="docbook-wrapper.xsl" append="true"
  92. message=" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"/>
  93. <echo file="docbook-wrapper.xsl" append="true"
  94. message=" version='1.0'&gt;"/>
  95. <echo file="docbook-wrapper.xsl" append="true"
  96. message="&lt;xsl:import href='${docbook.xsl}/html/chunk.xsl'/&gt;"/>
  97. <echo file="docbook-wrapper.xsl" append="true"
  98. message="&lt;/xsl:stylesheet&gt;"/>
  99. <available file="users-guide.xsl" property="users-guide.xsl" value="users-guide.xsl"/>
  100. <antcall target="init-users-guide"/>
  101. <property name="users-guide.xsl" value="default-users-guide.xsl"/>
  102. <available file="users-guide.xml" property="call.docs"/>
  103. <uptodate property="build-docs.not-required"
  104. targetfile="${build.dir}/users-guide.html">
  105. <srcfiles dir="." includes="users-guide.xml"/>
  106. </uptodate>
  107. </target>
  108. <!-- }}} -->
  109. <!-- {{{ 'init-users-guide' target -->
  110. <target name="init-users-guide" unless="users-guide.xsl"
  111. description="Create a users-guide.xsl if one doesn't exist">
  112. <copy tofile="default-users-guide.xsl" file="../users-guide.xsl"/>
  113. </target>
  114. <!-- }}} -->
  115. <!-- {{{ 'compile' target -->
  116. <target name="compile" depends="init" description="Compile project files">
  117. <javac srcdir="${src.dir}" destdir="${build.dir}"
  118. includeJavaRuntime="yes" verbose="${compiler.verbose}"
  119. optimize="${compiler.optimize}" debug="${compiler.debug}"
  120. deprecation="${compiler.deprecation}">
  121. <classpath refid="project.class.path"/>
  122. </javac>
  123. </target>
  124. <!-- }}} -->
  125. <!-- {{{ 'dist' target -->
  126. <target name="dist" depends="compile, docs" description="Builds the plugin jar">
  127. <mkdir dir="${install.dir}"/>
  128. <jar jarfile="${install.dir}/${jar.name}">
  129. <fileset dir="${build.dir}"/>
  130. <fileset dir="${src.dir}">
  131. <patternset refid="include-from-source"/>
  132. </fileset>
  133. </jar>
  134. </target>
  135. <!-- }}} -->
  136. <!-- {{{ 'docs' target -->
  137. <target name="docs" depends="init" if="call.docs" unless="build-docs.not-required"
  138. description="Builds users guide documentation">
  139. <antcall target="docs-${docs-proc.target}"/>
  140. </target>
  141. <!-- }}} -->
  142. <!-- {{{ 'docs-xsltproc' target -->
  143. <target name="docs-xsltproc"
  144. description="Generate docs with xsltproc tool from www.xmlsoft.org">
  145. <exec executable="${xsltproc}">
  146. <arg value="--output"/><arg value="${build.dir}/index.html"/>
  147. <arg value="--catalogs"/>
  148. <arg value="${users-guide.xsl}"/>
  149. <arg value="users-guide.xml"/>
  150. </exec>
  151. </target>
  152. <!-- }}} -->
  153. <!-- {{{ 'docs-xalan' target -->
  154. <target name="docs-xalan"
  155. description="Generate docs with Xalan tool from xml.apache.org">
  156. <style style="${users-guide.xsl}" in="users-guide.xml"
  157. out="${build.dir}/index.html"/>
  158. </target>
  159. <!-- }}} -->
  160. <!-- {{{ 'clean' target -->
  161. <target name="clean" description="Clean project directory">
  162. <delete dir="${build.dir}"/>
  163. <delete>
  164. <fileset dir="." defaultexcludes="no">
  165. <include name="**/*~"/>
  166. <include name="**/*.html"/>
  167. <include name="docbook-wrapper.xsl"/>
  168. <include name="default-users-guide.xsl"/>
  169. </fileset>
  170. </delete>
  171. </target>
  172. <!-- }}} -->
  173. <!-- }}} -->
  174. </project>