build.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project default="generate.all"
  3. basedir="."
  4. name="org.yakindu.sct.doc.user"
  5. xmlns:if="ant:if"
  6. xmlns:unless="ant:unless"
  7. xmlns:artifact="antlib:org.eclipse.aether.ant">
  8. <!-- Include platform-specific or machine-specific properties, if any. -->
  9. <property file="local.properties" />
  10. <!-- The documentation source files located beneath this directory.
  11. They may be structured into folders of arbitrary depth. -->
  12. <property name="src.dir" value="src" />
  13. <!-- CSS files are located here. -->
  14. <property name="css.dir" value="css" />
  15. <!-- Root CSS file to be referenced by the generated HTML files. -->
  16. <property name="css.root.file" value="style.css" />
  17. <!-- Image files reside in subdirectories with the following name: -->
  18. <property name="img.dir" value="images" />
  19. <!-- Target directories for various output formats: -->
  20. <property name="help.dir" value="help" />
  21. <property name="html.dir" value="html" />
  22. <property name="pdf.dir" value="pdf" />
  23. <property name="epub.dir" value="epub" />
  24. <!-- Libraries used by various Ant tasks are located here: -->
  25. <property name="lib.dir" location="${basedir}/lib" />
  26. <!-- Aether Ant Tasks configuration -->
  27. <property name="aether.jar.version" value="1.0.0.v20140518" />
  28. <property name="aether.jar.checksum"
  29. value="9008c0c96390eacc0f7fdde542dacbd921f942dcd5c139465e21f8b583942edb995304025bb436cfeeea0b89698ef9dfccf8a027da68cd079669adea8cca381f" />
  30. <property name="aether.jar.src"
  31. value="http://search.maven.org/remotecontent?filepath=org/eclipse/aether/aether-ant-tasks/${aether.jar.version}/aether-ant-tasks-${aether.jar.version}-uber.jar" />
  32. <property name="aether.jar.file" value="${lib.dir}/aether-ant-tasks-uber.jar" />
  33. <!-- Wikitext download configuration -->
  34. <property name="wikitext.zip.version" value="1.0.0.v20140518" />
  35. <property name="wikitext.zip.checksum"
  36. value="00d8bf79a9d7baf20e46d2435dd4b6a9963317a2737c731d11029c96aa86f64e8540639b6eefa6f04b8103860f47ff74e998c71b57445179dc20ad7c2847417c" />
  37. <!--
  38. <property name="wikitext.zip.src"
  39. value="http://www.eclipse.org/downloads/download.php?file=/mylyn/snapshots/nightly/docs/wikitext-standalone-latest.zip" />
  40. -->
  41. <property name="wikitext.zip.src" value="file:///${basedir}/externals/wikitext.zip" />
  42. <property name="wikitext.zip.file" value="${lib.dir}/wikitext.zip" />
  43. <property name="wikitext.basename" value="wikitext-standalone" />
  44. <property name="wikitext.version" value="2.8.0-SNAPSHOT" />
  45. <!-- Remove generated stuff: -->
  46. <target name="clean">
  47. <delete includeemptydirs="true" failonerror="false">
  48. <fileset dir="${basedir}" defaultexcludes="false">
  49. <include name="${help.dir}/**" />
  50. <include name="${html.dir}/**" />
  51. <include name="${pdf.dir}/**" />
  52. <include name="${epub.dir}/**" />
  53. </fileset>
  54. </delete>
  55. </target>
  56. <!-- Download and unpack the wikitext standalone distribution. Unfortunately it is currently available as a nightly build only. -->
  57. <target name="wikitext.download" description="Download and unpack the wikitext standalone distribution.">
  58. <condition property="wikitext.zip.file.exists">
  59. <and>
  60. <available file="${wikitext.zip.file}" />
  61. <checksum file="${wikitext.zip.file}"
  62. algorithm="SHA-512"
  63. property="${wikitext.zip.checksum}"
  64. verifyproperty="checksum.matches" />
  65. </and>
  66. </condition>
  67. <sequential unless:set="wikitext.zip.file.exists">
  68. <mkdir dir="${lib.dir}" />
  69. <get src="${wikitext.zip.src}"
  70. dest="${wikitext.zip.file}"
  71. skipexisting="false"
  72. usetimestamp="true"
  73. verbose="true" />
  74. <fail message="Checksum mismatch for ${wikitext.zip.file}. Please delete it and rerun ant to redownload.">
  75. <condition>
  76. <not>
  77. <checksum file="${wikitext.zip.file}"
  78. algorithm="SHA-512"
  79. property="${wikitext.zip.checksum}"
  80. verifyproperty="checksum.matches" />
  81. </not>
  82. </condition>
  83. </fail>
  84. <unzip dest="${lib.dir}" src="${wikitext.zip.file}" />
  85. </sequential>
  86. </target>
  87. <!-- Resolves the necessary dependencies: -->
  88. <target name="init.wikitext"
  89. description="Resolves the necessary wikitext dependencies."
  90. depends="wikitext.download">
  91. <property name="wikitext.dir" location="${lib.dir}/${wikitext.basename}-${wikitext.version}" />
  92. <path id="wikitext.classpath">
  93. <fileset dir="${wikitext.dir}">
  94. <include name="*.jar" />
  95. </fileset>
  96. </path>
  97. </target>
  98. <!-- Generates the documentation in all supported formats. -->
  99. <target name="generate.all"
  100. description="Generates the documentation in all supported formats."
  101. depends="generate.eclipsehelp" />
  102. <!-- Generates the documentation as Eclipse help. -->
  103. <target name="generate.eclipsehelp"
  104. description="Generates the documentation as separate Eclipse help (HTML) files from their respective textile (wikitext) sources."
  105. depends="init.wikitext">
  106. <sequential>
  107. <taskdef classpathref="wikitext.classpath"
  108. resource="org/eclipse/mylyn/wikitext/core/ant/tasks.properties" />
  109. <!-- Convert textile source files to HTML: -->
  110. <wikitext-to-eclipse-help markupLanguage="Textile"
  111. multipleOutputFiles="false"
  112. navigationImages="true"
  113. formatoutput="true"
  114. validate="true"
  115. failOnValidationError="true"
  116. failOnValidationWarning="false"
  117. title="YAKINDU Statechart Tools – Open Source Edition"
  118. helpPrefix="${help.dir}">
  119. <fileset dir="${src.dir}">
  120. <include name="**/*.textile" />
  121. </fileset>
  122. <stylesheet url="../${css.dir}/${css.root.file}" />
  123. </wikitext-to-eclipse-help>
  124. <!-- Files have been generated in the source directory, which is bad practice. Move them to the destination
  125. directory: -->
  126. <move todir="${help.dir}" flatten="no" verbose="no">
  127. <fileset dir="${src.dir}">
  128. <include name="**/*.html" />
  129. <include name="**/*-toc.xml" />
  130. </fileset>
  131. </move>
  132. <!-- Copy the CSS files to the destination directory: -->
  133. <copy todir="${help.dir}/${css.dir}">
  134. <fileset dir="${css.dir}">
  135. <include name="*" />
  136. </fileset>
  137. </copy>
  138. <!-- Copy the image files to the destination directory: -->
  139. <copy todir="${help.dir}">
  140. <fileset dir="src">
  141. <include name="**/${img.dir}/*" />
  142. </fileset>
  143. </copy>
  144. </sequential>
  145. </target>
  146. </project>