build.xml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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}/user/02_Getting_Started" src.file="getting_started.textile" prefix="${help.prefix}/user/02_Getting_Started" />
  23. <generate.section.help src.dir="${help.dir}/user/03_Concepts" src.file="concepts.textile" prefix="${help.prefix}/user/03_Concepts"/>
  24. <generate.section.help src.dir="${help.dir}/user/04_Tasks" src.file="tasks.textile" prefix="${help.prefix}/user/04_Tasks" />
  25. <generate.section.help src.dir="${help.dir}/user/05_Reference" src.file="reference.textile" prefix="${help.prefix}/user/05_Reference" />
  26. <generate.section.help src.dir="${help.dir}/developer/01_Overview" src.file="overview.textile" prefix="${help.prefix}/developer/01_Overview" />
  27. <generate.section.help src.dir="${help.dir}/developer/02_Getting_Started" src.file="getting_started.textile" prefix="${help.prefix}/developer/02_Getting_Started" />
  28. <generate.section.help src.dir="${help.dir}/developer/03_Concepts" src.file="concepts.textile" prefix="${help.prefix}/developer/03_Concepts"/>
  29. <generate.section.help src.dir="${help.dir}/developer/04_Tasks" src.file="tasks.textile" prefix="${help.prefix}/developer/04_Tasks" />
  30. <generate.section.help src.dir="${help.dir}/developer/05_Reference" src.file="reference.textile" prefix="${help.prefix}/developer/05_Reference" />
  31. </target>
  32. <target name="clean">
  33. <delete>
  34. <fileset dir="${help.dir}">
  35. <include name="**/**/*.html" />
  36. <include name="**/**/*toc.xml" />
  37. <!-- Include joined source files produced by assemble.sections here
  38. <include name="**/**/c_code_generator.textile" />
  39. <include name="**/**/java_code_generator.textile" />-->
  40. </fileset>
  41. </delete>
  42. </target>
  43. <macrodef name="assemble.section.sources" description="Concats individual wiki source files">
  44. <attribute name="src.dir" />
  45. <attribute name="index.file" default="@{src.dir}/index.txt" />
  46. <attribute name="src.list" />
  47. <attribute name="dest.file" />
  48. <sequential>
  49. <loadfile srcfile="@{index.file}" property="@{src.list}">
  50. <filterchain>
  51. <tokenfilter>
  52. <replacestring from="\n" to="," />
  53. </tokenfilter>
  54. </filterchain>
  55. </loadfile>
  56. <!-- Attribute fixlastline does not work (on the Mac). Begin wiki files with new line for now! -->
  57. <concat destfile="@{src.dir}/@{dest.file}" append="false" fixlastline="yes">
  58. <filelist dir="@{src.dir}" files="${@{src.list}}" />
  59. </concat>
  60. </sequential>
  61. </macrodef>
  62. <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">
  63. <attribute name="src.dir" />
  64. <attribute name="src.file" />
  65. <attribute name="prefix" />
  66. <sequential>
  67. <wikitext-to-eclipse-help markupLanguage="Textile" multipleOutputFiles="false" navigationImages="true" formatoutput="true" helpPrefix="@{prefix}">
  68. <fileset dir="@{src.dir}">
  69. <include name="@{src.file}" />
  70. </fileset>
  71. <stylesheet url="../style.css" />
  72. </wikitext-to-eclipse-help>
  73. </sequential>
  74. </macrodef>
  75. </project>