/plugins/SVNPlugin/tags/0.5.1/build.xml

# · XML · 240 lines · 129 code · 39 blank · 72 comment · 0 complexity · 78554b39e679a021c6bb058b56505987 MD5 · raw file

  1. <project name="SVNPlugin" default="dist" basedir=".">
  2. <!-- read build.props to override properties set below -->
  3. <property file="../build.properties"/>
  4. <property file="build.properties"/>
  5. <!-- default location of jedit.jar -->
  6. <property name="jedit.install.dir" value="../.."/>
  7. <!-- jar name -->
  8. <property name="jar.name" value="${ant.project.name}.jar"/>
  9. <!-- version number -->
  10. <property name="build.num" value="1.0.0"/>
  11. <!-- where to put the finished plugin -->
  12. <property name="install.dir" value=".." />
  13. <!-- source code directory, this is where the .java files live -->
  14. <property name="src.dir" location="src" />
  15. <mkdir dir="${src.dir}"/>
  16. <!-- library directory, location for third party jars -->
  17. <property name="lib.dir" location="lib"/>
  18. <mkdir dir="${lib.dir}"/>
  19. <!-- temporary directory for post-compile processing -->
  20. <property name="build.dir" location="build"/>
  21. <mkdir dir="${build.dir}"/>
  22. <!-- configuration directory, this is where the configuration files for the
  23. plugin are placed for additional processing prior to getting jarred. -->
  24. <property name="config.dir" location="${build.dir}/config" />
  25. <mkdir dir="${config.dir}"/>
  26. <!-- documentation directory, this is where the plugin documentation
  27. files live. Files in this directory will be distributed with the plugin -->
  28. <property name="doc.dir" location="${build.dir}/docs" />
  29. <mkdir dir="${doc.dir}"/>
  30. <!-- the directory for the compiled classes. Files in this directory will be
  31. included in the finished jar file. -->
  32. <property name="classes.dir" location="${build.dir}/classes" />
  33. <mkdir dir="${classes.dir}"/>
  34. <!-- ========================================================================
  35. Target: set classpath
  36. ========================================================================= -->
  37. <target name="setClasspath">
  38. <path id="classpathref">
  39. <!-- required locations/jars -->
  40. <pathelement location="${classes.dir}" />
  41. <pathelement path="${java.class.path}"/>
  42. <!-- SVNKit jars -->
  43. <pathelement location="${lib.dir}/ganymed.jar"/>
  44. <pathelement location="${lib.dir}/svnkit-cli.jar"/>
  45. <pathelement location="${lib.dir}/svnkit.jar"/>
  46. <pathelement location="${lib.dir}/svnkit-javahl.jar"/>
  47. <!-- required for jEdit plugin -->
  48. <pathelement location="${jedit.install.dir}/jedit.jar" />
  49. <!-- dependencies -->
  50. <pathelement location="${install.dir}/ProjectViewer.jar"/>
  51. <pathelement location="${install.dir}/kappalayout.jar"/>
  52. <pathelement location="${install.dir}/Console.jar"/>
  53. <pathelement location="${install.dir}/xml-apis.jar"/>
  54. <pathelement location="${install.dir}/xercesImpl.jar"/>
  55. <pathelement location="${install.dir}/JDiffPlugin.jar"/>
  56. </path>
  57. </target>
  58. <!-- ========================================================================
  59. Target: compile
  60. ========================================================================= -->
  61. <target name="compile"
  62. description="Compile"
  63. depends="init,setClasspath">
  64. <javac deprecation="on"
  65. debug="on"
  66. nowarn="on"
  67. destdir="${classes.dir}"
  68. srcdir="${src.dir}"
  69. target="1.5"
  70. source="1.5">
  71. <classpath refid="classpathref" />
  72. <compilerarg value="-Xlint:unchecked"/>
  73. </javac>
  74. <copy todir="${classes.dir}/docs" overwrite="no">
  75. <fileset dir="${src.dir}/docs">
  76. <include name="**/*"/>
  77. </fileset>
  78. </copy>
  79. </target>
  80. <!-- ========================================================================
  81. Target: dist
  82. creates jar file suitable for dropping into jEdit, and puts it up one
  83. directory level
  84. ========================================================================= -->
  85. <target name="dist"
  86. description="Compiles, jars, puts the jar in the jEdit jars directory."
  87. depends="clean,init,compile,prep_files">
  88. <!-- make the plugin jar file -->
  89. <tstamp/>
  90. <jar jarfile="${install.dir}/${ant.project.name}.jar">
  91. <manifest>
  92. <attribute name="AppName" value="${ant.project.name}" />
  93. <attribute name="AppVersion" value="${build.num}" />
  94. <attribute name="Author" value="Dale Anson" />
  95. <attribute name="Created-By" value="${user.name}" />
  96. <attribute name="Created-On" value="${TODAY}"/>
  97. </manifest>
  98. <!-- include everything in the build directory -->
  99. <fileset dir="${classes.dir}">
  100. <include name="**/*" />
  101. </fileset>
  102. <!-- include everything in the config directory-->
  103. <fileset dir="${config.dir}">
  104. <include name="**/*" />
  105. </fileset>
  106. <!-- include everything in the doc directory -->
  107. <fileset dir="${doc.dir}">
  108. <include name="**/*" />
  109. </fileset>
  110. </jar>
  111. <copy todir="${install.dir}">
  112. <fileset dir="${lib.dir}">
  113. <include name="*.jar"/>
  114. </fileset>
  115. </copy>
  116. </target>
  117. <!-- ========================================================================
  118. Target: prep_files
  119. prepares certain files for distribution by doing string replacement.
  120. Assumes that the configuration files and documentation files are ready.
  121. ========================================================================= -->
  122. <target name="prep_files">
  123. <echo>preparing files</echo>
  124. <!-- clean out the config and doc deployment directories -->
  125. <delete>
  126. <fileset dir="${config.dir}" includes="**/*"/>
  127. <fileset dir="${doc.dir}" includes="**/*"/>
  128. </delete>
  129. <!-- copy the config files to deployment directory
  130. CHANGED: apparently, having a 'src/config' directory to hold the configuration
  131. files is too confusing, so now they are dumped in basedir, along with
  132. any other crud that may or may not be part of the deployment package.
  133. Now need to explicitly name the proper files, so we don't pick up the
  134. crud.
  135. -->
  136. <copy todir="${config.dir}">
  137. <fileset dir="${basedir}">
  138. <include name="SVNPlugin.props"/>
  139. <include name="dockables.xml"/>
  140. <include name="actions.xml"/>
  141. </fileset>
  142. </copy>
  143. <!-- copy the docs -->
  144. <copy todir="${doc.dir}/docs" overwrite="yes">
  145. <fileset dir="${src.dir}/docs">
  146. <include name="**/*"/>
  147. </fileset>
  148. </copy>
  149. <!-- insert the build number into the documentation and configuration
  150. files -->
  151. <!-- CHANGED: don't do this, the python build system for jEdit gets
  152. confused if the build number isn't present BEFORE the build, so need
  153. to change it by hand everytime there is a new release.
  154. <replace dir="${config.dir}" token="@@build.num@@"
  155. value="${build.num}" />
  156. -->
  157. <replace dir="${doc.dir}" token="@@build.num@@"
  158. value="${build.num}" />
  159. <tstamp/>
  160. <replace dir="${doc.dir}" token="@@tstamp@@"
  161. value="${TODAY}" />
  162. </target>
  163. <!-- ========================================================================
  164. Target: clean
  165. deletes all files from the temp directory
  166. ========================================================================= -->
  167. <target name="clean" description="Delete all files from the classes directory.">
  168. <!-- delete old directories that may still be hanging around. These
  169. caused some confusion. -->
  170. <delete dir="${classes.dir}"/>
  171. <delete dir="${build.dir}"/>
  172. <mkdir dir="${classes.dir}"/>
  173. <mkdir dir="${build.dir}"/>
  174. <!--
  175. <delete file="${install.dir}/ganymed.jar"/>
  176. <delete file="${install.dir}/svnkit-cli.jar"/>
  177. <delete file="${install.dir}/svnkit.jar"/>
  178. <delete file="${install.dir}/svnkit-javahl.jar"/>
  179. -->
  180. </target>
  181. <!-- ========================================================================
  182. Target: init
  183. this target creates the directories needed for this project and
  184. only needs to be done once.
  185. ========================================================================= -->
  186. <target name="init"
  187. description="Create directory structure.">
  188. <fail unless="jedit.install.dir" message="Please set jedit.install.dir property."/>
  189. <mkdir dir="${src.dir}" />
  190. <mkdir dir="${classes.dir}" />
  191. <mkdir dir="${doc.dir}" />
  192. <mkdir dir="${config.dir}" />
  193. </target>
  194. <target name="run"
  195. description="run"
  196. depends="init,setClasspath">
  197. <java classname="ise.plugin.svn.action.ProjectGroupLoader">
  198. <classpath refid="classpathref" />
  199. </java>
  200. </target>
  201. </project>