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.

audit.xml 3.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <project default="main" basedir=".">
  2. <property file="host.properties"/>
  3. <property file="user.properties"/>
  4. <property file="project.properties"/>
  5. <property file="workspace.properties"/>
  6. <property name="output.dir" value="output"/>
  7. <property name="audit.dir" value="${output.dir}/audit"/>
  8. <property name="audit.xml" location="${audit.dir}/audit.xml"/>
  9. <property name="metrics.dir" value="${output.dir}/metrics"/>
  10. <property name="metrics.xml" value="${metrics.dir}/metrics.xml"/>
  11. <property name="audit.fix" location="false"/>
  12. <!-- custom Audit rules -->
  13. <path id="custom-rules">
  14. <pathelement location="${metamata.home}/rules"/>
  15. </path>
  16. <path id="project.class.path">
  17. <pathelement path="${java.class.path}" />
  18. <fileset dir="lib">
  19. <include name="*.jar" />
  20. </fileset>
  21. </path>
  22. <target name="main" depends="audit" description="Do audit"/>
  23. <target name="update" description="Update module source code">
  24. <echo message="Updating module ${project.dir}..."/>
  25. <cvs command="update" dest="${project.dir}"/>
  26. </target>
  27. <target name="audit">
  28. <mkdir dir="${audit.dir}"/>
  29. <maudit tofile="${audit.xml}" fix="${audit.fix}" metamatahome="${metamata.home}">
  30. <!-- <rulespath refid="custom-rules"/>-->
  31. <classpath refid="project.class.path"/>
  32. <sourcepath path="${project.src.path}"/>
  33. <fileset dir="src/java" includes="**/*.java"/>
  34. <fileset dir="src/main" includes="**/*.java"/>
  35. </maudit>
  36. </target>
  37. <target name="metrics" description="Source code metrics">
  38. <mkdir dir="${metrics.dir}"/>
  39. <mmetrics tofile="${metrics.xml}" metamatahome="${metamata.home}" granularity="methods">
  40. <classpath refid="project.class.path"/>
  41. <sourcepath path="${project.src.path}"/>
  42. <path path="${project.src.path}"/>
  43. </mmetrics>
  44. </target>
  45. <!--
  46. ==========================================================================
  47. Common targets
  48. ==========================================================================
  49. -->
  50. <target name="publish-audit" description="Publish Audit results">
  51. <echo message="Generating results..."/>
  52. <style in="${audit.xml}" out="null.tmp" style="maudit-frames.xsl">
  53. <param name="output.dir" expression="${audit.dir}"/>
  54. </style>
  55. <echo message="Generating e-mail body..."/>
  56. <style in="${audit.xml}" out="${audit.dir}/mail.txt" style="maudit-mail.xsl">
  57. <param name="project.url" expression="${project.url}"/>
  58. </style>
  59. </target>
  60. <target name="publish-metrics" description="Publish Metric results">
  61. <echo message="Generating metrics results..."/>
  62. <style in="${metrics.xml}" out="null.tmp" style="mmetrics-frames.xsl">
  63. <param name="output.dir" expression="${metrics.dir}"/>
  64. </style>
  65. <echo message="Generating metrics e-mail body..."/>
  66. <style in="${metrics.xml}" out="${metrics.dir}/mail.txt" style="metrics-mail.xsl">
  67. <param name="project.url" expression="${project.url}"/>
  68. </style>
  69. </target>
  70. <target name="sendmail">
  71. <mail from="${mail.from}" tolist="${mail.to}" mailhost="${mail.host}"
  72. subject="${mail.subject}" messagefile="${mail.file}"/>
  73. </target>
  74. </project>