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 5.2 kB

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