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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. <property name="the.classpath" refid="xdoclet.classpath"/>
  40. <echo>the.classpath = ${the.classpath}</echo>
  41. <taskdef name="document"
  42. classname="xdoclet.doc.DocumentDocletTask"
  43. classpathref="xdoclet.classpath"/>
  44. </target>
  45. <target name="clean">
  46. <delete dir="${build.dir}"/>
  47. </target>
  48. <target name="compile" depends="init">
  49. <javac srcdir="src" destdir="${build.dir}"
  50. debug="true" classpathref="xdoclet.classpath"/>
  51. <taskdef name="xdocs"
  52. classname="org.apache.tools.ant.xdoclet.AntXDocletTask"
  53. classpathref="xdoclet.classpath"/>
  54. </target>
  55. <target name="gen" depends="compile">
  56. <xdocs sourcepath="${src.root}"
  57. destdir="${gen.dir}"
  58. mergedir="${basedir}/src"
  59. classpathref="xdoclet.classpath">
  60. <fileset dir="${src.dir}">
  61. <include name="**/*.java" unless="class.name"/>
  62. <include name="**/*${class.name}*.java" if="class.name"/>
  63. </fileset>
  64. <!-- Generate XML task descriptor files -->
  65. <tasks templateFile="${task_xdoc.template}"
  66. destinationfile="{0}.xml"/>
  67. <!-- Generate XML datatype descriptor files -->
  68. <!-- <datatypes templateFile="${datatype_xdoc.template}"
  69. destdir="${gen.dir}/datatypes"
  70. destinationfile="{0}.xml"/> -->
  71. <!-- @todo - with some additional logic in these subtasks, they
  72. could be used similar to above instead of <template> -->
  73. <!-- Generate task defaults.properties -->
  74. <template subTaskClassName="org.apache.tools.ant.xdoclet.TaskSubTask"
  75. templateFile="${task.properties.template}"
  76. destinationfile="task_defaults.properties"/>
  77. <!-- Generate datatype defaults.properties -->
  78. <!-- <template subTaskClassName="org.apache.tools.ant.xdoclet.DatatypeSubTask"
  79. templateFile="${type.properties.template}"
  80. destinationfile="type_defaults.properties"/> -->
  81. <!-- Generate to-do list -->
  82. <!-- <info destdir="${gen.dir}/todo/ant"
  83. header="To-do List"
  84. projectname="Ant"/> -->
  85. </xdocs>
  86. </target>
  87. <target name="document" depends="init">
  88. <document sourcepath="${basedir}/src"
  89. destdir="${gen.dir}"
  90. mergedir="${basedir}/src"
  91. classpathref="xdoclet.classpath">
  92. <fileset dir="${basedir}/src">
  93. <include name="**/*.java" unless="class.name"/>
  94. <include name="**/${class.name}.java" if="class.name"/>
  95. </fileset>
  96. <info destdir="${gen.dir}/todo/xdocs"/>
  97. <!-- This is currently broken, checking into...
  98. <documenttags/> -->
  99. </document>
  100. </target>
  101. <target name="docs"> <!-- depends=gen -->
  102. <mkdir dir="${build.dir}/docs" />
  103. <!-- Copy stuff so things are in the correct relative location. -->
  104. <copy todir="${build.dir}/docs">
  105. <fileset dir="${basedir}/../../docs" includes="artwork/**" />
  106. </copy>
  107. <mkdir dir="${basedir}/xdocs" />
  108. <copy todir="${basedir}/xdocs">
  109. <fileset dir="${docs.src}" includes="stylesheets/project.xml" />
  110. </copy>
  111. <!-- Generate HTML using DVSL -->
  112. <ant dir="dvsl"/>
  113. </target>
  114. <target name="main" depends="gen,document"/>
  115. </project>