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.8 kB

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