build.xml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project default="generate.help" basedir=".">
  3. <property name="wikitext.standalone" location="${basedir}/lib" />
  4. <property name="help.prefix" value="help" />
  5. <property name="help.dir" location="${basedir}/${help.prefix}" />
  6. <path id="wikitext.classpath">
  7. <fileset dir="${wikitext.standalone}">
  8. <include name="org.eclipse.mylyn.wikitext.*core*.jar" />
  9. </fileset>
  10. </path>
  11. <taskdef classpathref="wikitext.classpath" resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties" />
  12. <target name="assemble.sections" description="Joins individual wiki source files so that they can be presented to the Eclipse help generator as a single file.">
  13. <assemble.section.sources src.dir="${help.dir}/04_C-Code_Generator" src.list="sec_04" dest.file="c_code_generator.textile" />
  14. <assemble.section.sources src.dir="${help.dir}/05_Java-Code_Generator" src.list="sec_05" dest.file="java_code_generator.textile" />
  15. </target>
  16. <!-- Building the master TOC (toc.xml) and registering it along with the sub-TOCs produced by this target in the plugin.xml file must still be done manually. -->
  17. <!-- The help contexts file (contexts.xml) is not yet updated automatically, either. -->
  18. <!--<target name="generate.help" depends="assemble.sections" description="Runs the Eclipse help generator on the listed wiki source files">
  19. -->
  20. <target name="generate.help" description="Runs the Eclipse help generator on the listed wiki source files">
  21. <generate.section.help src.dir="${help.dir}/01_Overview" src.file="overview.textile" prefix="${help.prefix}/01_Overview" />
  22. <generate.section.help src.dir="${help.dir}/02_Getting_started" src.file="getting_started.textile" prefix="${help.prefix}/02_Getting_started" />
  23. <generate.section.help src.dir="${help.dir}/03_Tasks" src.file="tasks.textile" prefix="${help.prefix}/03_Tasks" />
  24. <generate.section.help src.dir="${help.dir}/04_Reference" src.file="reference.textile" prefix="${help.prefix}/04_Reference" />
  25. </target>
  26. <target name="clean">
  27. <delete>
  28. <fileset dir="${help.dir}">
  29. <include name="**/**/*.html" />
  30. <include name="**/**/*toc.xml" />
  31. <!-- Include joined source files produced by assemble.sections here
  32. <include name="**/**/c_code_generator.textile" />
  33. <include name="**/**/java_code_generator.textile" />-->
  34. </fileset>
  35. </delete>
  36. </target>
  37. <macrodef name="assemble.section.sources" description="Concats individual wiki source files">
  38. <attribute name="src.dir" />
  39. <attribute name="index.file" default="@{src.dir}/index.txt" />
  40. <attribute name="src.list" />
  41. <attribute name="dest.file" />
  42. <sequential>
  43. <loadfile srcfile="@{index.file}" property="@{src.list}">
  44. <filterchain>
  45. <tokenfilter>
  46. <replacestring from="\n" to="," />
  47. </tokenfilter>
  48. </filterchain>
  49. </loadfile>
  50. <!-- Attribute fixlastline does not work (on the Mac). Begin wiki files with new line for now! -->
  51. <concat destfile="@{src.dir}/@{dest.file}" append="false" fixlastline="yes">
  52. <filelist dir="@{src.dir}" files="${@{src.list}}" />
  53. </concat>
  54. </sequential>
  55. </macrodef>
  56. <macrodef name="generate.section.help" description="Runs the Eclipse help generator on the provided wiki input file. Produces an HTML document and a corresponding toc.xml">
  57. <attribute name="src.dir" />
  58. <attribute name="src.file" />
  59. <attribute name="prefix" />
  60. <sequential>
  61. <wikitext-to-eclipse-help markupLanguage="Textile" multipleOutputFiles="false" navigationImages="true" formatoutput="true" helpPrefix="@{prefix}">
  62. <fileset dir="@{src.dir}">
  63. <include name="@{src.file}" />
  64. </fileset>
  65. <stylesheet url="../style.css" />
  66. </wikitext-to-eclipse-help>
  67. </sequential>
  68. </macrodef>
  69. </project>