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

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