You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 4.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" ?>
  2. <project name="XDoclet" default="main">
  3. <property name="log4j.jar" location="../../lib/optional/log4j.jar"/>
  4. <property name="xdoclet.jar" location="lib/xdoclet.jar"/>
  5. <property name="src.dir"
  6. location="../../src/main/org/apache/tools/ant"/>
  7. <property name="src.root"
  8. location="../../src/main"/>
  9. <property name="docs.src"
  10. location="../../xdocs"/>
  11. <property name="build.dir" location="build"/>
  12. <property name="gen.dir" location="${build.dir}/gen"/>
  13. <property name="template.dir" location="templates"/>
  14. <property name="task.properties.template"
  15. location="${template.dir}/task_defaults_properties.template"/>
  16. <property name="type.properties.template"
  17. location="${template.dir}/type_defaults_properties.template"/>
  18. <property name="task_xdoc.template"
  19. location="${template.dir}/task_xdoc.template"/>
  20. <property name="datatype_xdoc.template"
  21. location="${template.dir}/datatype_xdoc.template"/>
  22. <target name="init">
  23. <mkdir dir="${build.dir}" />
  24. <mkdir dir="${gen.dir}" />
  25. <!-- hack, this should be outside a target but ${build.dir} gets stripped ?? -->
  26. <path id="xdoclet.classpath">
  27. <pathelement location="${log4j.jar}"/>
  28. <pathelement location="${xdoclet.jar}"/>
  29. <!-- javadoc is needed -->
  30. <pathelement path="${java.class.path}"/>
  31. <pathelement location="${build.dir}"/>
  32. </path>
  33. <taskdef name="document"
  34. classname="xdoclet.doc.DocumentDocletTask"
  35. classpathref="xdoclet.classpath"/>
  36. </target>
  37. <target name="clean">
  38. <delete dir="${build.dir}"/>
  39. </target>
  40. <target name="compile" depends="init">
  41. <javac srcdir="src" destdir="${build.dir}"
  42. debug="true" classpathref="xdoclet.classpath"/>
  43. <taskdef name="xdocs"
  44. classname="org.apache.tools.ant.xdoclet.AntXDocletTask"
  45. classpathref="xdoclet.classpath"/>
  46. </target>
  47. <target name="gen" depends="compile">
  48. <xdocs sourcepath="${src.root}"
  49. destdir="${gen.dir}"
  50. mergedir="${basedir}/src"
  51. classpathref="xdoclet.classpath">
  52. <fileset dir="${src.dir}">
  53. <include name="**/*.java" unless="class.name"/>
  54. <include name="**/${class.name}.java" if="class.name"/>
  55. </fileset>
  56. <!-- Generate XML task descriptor files -->
  57. <tasks templateFile="${task_xdoc.template}"
  58. destinationfile="{0}.xml"/>
  59. <!-- Generate XML datatype descriptor files -->
  60. <datatypes templateFile="${datatype_xdoc.template}"
  61. destdir="${gen.dir}/datatypes"
  62. destinationfile="{0}.xml"/>
  63. <!-- @todo - with some additional logic in these subtasks, they
  64. could be used similar to above instead of <template> -->
  65. <!-- Generate task defaults.properties -->
  66. <template subTaskClassName="org.apache.tools.ant.xdoclet.TaskSubTask"
  67. templateFile="${task.properties.template}"
  68. destinationfile="task_defaults.properties"/>
  69. <!-- Generate datatype defaults.properties -->
  70. <template subTaskClassName="org.apache.tools.ant.xdoclet.DatatypeSubTask"
  71. templateFile="${type.properties.template}"
  72. destinationfile="type_defaults.properties"/>
  73. <!-- Generate to-do list -->
  74. <info destdir="${gen.dir}/todo/ant"
  75. header="To-do List"
  76. projectname="Ant"/>
  77. </xdocs>
  78. </target>
  79. <target name="document" depends="init">
  80. <document sourcepath="${basedir}/src"
  81. destdir="${gen.dir}"
  82. mergedir="${basedir}/src"
  83. classpathref="xdoclet.classpath">
  84. <fileset dir="${basedir}/src">
  85. <include name="**/*.java" unless="class.name"/>
  86. <include name="**/${class.name}.java" if="class.name"/>
  87. </fileset>
  88. <info destdir="${gen.dir}/todo/xdocs"/>
  89. <!-- This is currently broken, checking into...
  90. <documenttags/> -->
  91. </document>
  92. </target>
  93. <target name="docs" depends="gen">
  94. <mkdir dir="${build.dir}/docs" />
  95. <!-- Copy stuff so things are in the correct relative location. -->
  96. <copy todir="${build.dir}/docs">
  97. <fileset dir="${basedir}/../../docs" includes="artwork/**" />
  98. </copy>
  99. <mkdir dir="${basedir}/xdocs" />
  100. <copy todir="${basedir}/xdocs">
  101. <fileset dir="${docs.src}" includes="stylesheets/project.xml" />
  102. </copy>
  103. <!-- Generate HTML using DVSL -->
  104. <ant dir="dvsl"/>
  105. </target>
  106. <target name="main" depends="gen,document"/>
  107. </project>