Browse Source

Add a simple build file to generate audit/metric/etc statistics

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271388 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
34e1d54a2c
1 changed files with 89 additions and 0 deletions
  1. +89
    -0
      proposal/myrmidon/audit.xml

+ 89
- 0
proposal/myrmidon/audit.xml View File

@@ -0,0 +1,89 @@
<project default="main" basedir=".">

<property file="host.properties"/>
<property file="user.properties"/>
<property file="project.properties"/>
<property file="workspace.properties"/>

<property name="output.dir" value="output"/>
<property name="audit.dir" value="${output.dir}/audit"/>
<property name="audit.xml" location="${audit.dir}/audit.xml"/>
<property name="metrics.dir" value="${output.dir}/metrics"/>
<property name="metrics.xml" value="${metrics.dir}/metrics.xml"/>
<property name="audit.fix" location="false"/>

<!-- custom Audit rules -->
<path id="custom-rules">
<pathelement location="${metamata.home}/rules"/>
</path>

<path id="project.class.path">
<pathelement path="${java.class.path}" />
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>

<target name="main" depends="audit" description="Do audit"/>

<target name="update" description="Update module source code">
<echo message="Updating module ${project.dir}..."/>
<cvs command="update" dest="${project.dir}"/>
</target>

<target name="audit">
<mkdir dir="${audit.dir}"/>
<maudit tofile="${audit.xml}" fix="${audit.fix}" metamatahome="${webgain-qa.home}">
<!-- <rulespath refid="custom-rules"/>-->
<classpath refid="project.class.path"/>
<sourcepath path="${project.src.path}"/>
<fileset dir="src/java" includes="**/*.java"/>
<fileset dir="src/main" includes="**/*.java"/>
</maudit>
</target>

<target name="metrics" description="Source code metrics">
<mkdir dir="${metrics.dir}"/>
<mmetrics tofile="${metrics.xml}" metamatahome="${webgain-qa.home}" granularity="methods">
<classpath refid="project.class.path"/>
<sourcepath path="${project.src.path}"/>
<path path="${project.src.path}"/>
</mmetrics>
</target>

<!--
==========================================================================
Common targets
==========================================================================
-->

<target name="publish-audit" description="Publish Audit results">
<echo message="Generating results..."/>
<style in="${audit.xml}" out="null.tmp" style="maudit-frames.xsl">
<param name="output.dir" expression="${audit.dir}"/>
</style>

<echo message="Generating e-mail body..."/>
<style in="${audit.xml}" out="${audit.dir}/mail.txt" style="maudit-mail.xsl">
<param name="project.url" expression="${project.url}"/>
</style>
</target>

<target name="publish-metrics" description="Publish Metric results">
<echo message="Generating metrics results..."/>
<style in="${metrics.xml}" out="null.tmp" style="mmetrics-frames.xsl">
<param name="output.dir" expression="${metrics.dir}"/>
</style>

<echo message="Generating metrics e-mail body..."/>
<style in="${metrics.xml}" out="${metrics.dir}/mail.txt" style="metrics-mail.xsl">
<param name="project.url" expression="${project.url}"/>
</style>
</target>

<target name="sendmail">
<mail from="${mail.from}" tolist="${mail.to}" mailhost="${mail.host}"
subject="${mail.subject}" messagefile="${mail.file}"/>
</target>

</project>

Loading…
Cancel
Save