mirror of https://github.com/apache/ant-ivy
Add "rat" and "findbugs" targets. Copied from Ant's check.xml buildfile and slightly modified for Ivy.
git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/trunk@961246 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
98567abad2
commit
77acb96b49
95
build.xml
95
build.xml
|
|
@ -580,7 +580,102 @@
|
|||
</xslt>
|
||||
</target>
|
||||
|
||||
<target name="rat" description="runs the ReleaseAuditingTool" depends="init-ivy">
|
||||
<property name="rat.report.dir"
|
||||
value="${reports.dir}/rat"
|
||||
description="Where to store the RAT reports"/>
|
||||
<property name="rat.report.file"
|
||||
value="${rat.report.dir}/report.html"
|
||||
description="RAT-Report file"/>
|
||||
<property name="rat.version"
|
||||
value="0.6"
|
||||
description="Which Version of RAT to use"/>
|
||||
<ivy:cachepath organisation="org.apache.rat" module="apache-rat-tasks" revision="${rat.version}"
|
||||
inline="true" conf="default" pathid="rat.classpath" transitive="true"/>
|
||||
<typedef resource="org/apache/rat/anttasks/antlib.xml"
|
||||
uri="antlib:org.apache.rat.anttasks"
|
||||
classpathref="rat.classpath"/>
|
||||
<mkdir dir="${rat.report.dir}"/>
|
||||
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportfile="${rat.report.dir}/report.txt">
|
||||
<fileset dir="${src.dir}">
|
||||
<include name="**/*.java" />
|
||||
</fileset>
|
||||
<fileset dir="${example.dir}">
|
||||
<include name="**/*.java" />
|
||||
</fileset>
|
||||
</rat:report>
|
||||
</target>
|
||||
|
||||
<target name="init-findbugs" unless="findbugs.home">
|
||||
<!-- Findbugs: Getting Findbugs -->
|
||||
<property name="findbugs.download.name"
|
||||
value="findbugs-1.3.5"
|
||||
description="Name of the download file without suffix. Also the internal root directory of the ZIP."/>
|
||||
<property name="findbugs.download.file"
|
||||
value="${findbugs.download.name}.zip"
|
||||
description="The filename of the ZIP."/>
|
||||
<property name="findbugs.download.url"
|
||||
value="http://garr.dl.sourceforge.net/sourceforge/findbugs/${findbugs.download.file}"
|
||||
description="The download adress at a mirror of Sourceforge."/>
|
||||
<property name="findbugs.download.to"
|
||||
value=".downloads"
|
||||
description="Where to store the download and 'install' Findbugs."/>
|
||||
<available
|
||||
property="findbugs.home"
|
||||
value="${findbugs.download.to}/${findbugs.download.name}"
|
||||
file="${findbugs.download.to}/${findbugs.download.name}/lib/findbugs.jar"
|
||||
description="Check if Findbugs is already installed."
|
||||
/>
|
||||
|
||||
<!-- Findbugs: Running Findbugs -->
|
||||
<property name="findbugs.reportdir"
|
||||
location="${reports.dir}/findbugs"
|
||||
description="Where to store Findbugs results"/>
|
||||
<property name="findbugs.raw"
|
||||
value="raw.xml"
|
||||
description="Findbugs Output xml-file"/>
|
||||
<property name="findbugs.xsl"
|
||||
value="fancy.xsl"
|
||||
description="Which XSL to use for generating Output: default, fancy, plain, summary"/>
|
||||
<property name="findbugs.jvmargs"
|
||||
value="-Xms128m -Xmx512m"
|
||||
description="JVMArgs for invoking Findbugs"/>
|
||||
|
||||
<mkdir dir="${findbugs.download.to}"/>
|
||||
<get src="${findbugs.download.url}" dest="${findbugs.download.to}/${findbugs.download.file}"/>
|
||||
<unzip src="${findbugs.download.to}/${findbugs.download.file}" dest="${findbugs.download.to}"/>
|
||||
<property name="findbugs.home" location="${findbugs.download.to}/${findbugs.download.name}"/>
|
||||
<mkdir dir="${findbugs.home}/plugin"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs" description="checks Ivy codebase with Findbugs" depends="init-findbugs,compile-core" xmlns:fb="http://findbugs.sourceforge.net/">
|
||||
<path id="findbugs.real.classpath">
|
||||
<fileset dir="${findbugs.home}/lib" includes="*.jar"/>
|
||||
</path>
|
||||
|
||||
<!-- Load the Findbugs AntTasks -->
|
||||
<taskdef uri="http://findbugs.sourceforge.net/" resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpathref="findbugs.real.classpath" />
|
||||
|
||||
<!-- Start Findbugs -->
|
||||
<mkdir dir="${findbugs.reportdir}"/>
|
||||
<fb:findbugs home="${findbugs.home}"
|
||||
classpathref="findbugs.real.classpath"
|
||||
output="xml:withMessages"
|
||||
outputFile="${findbugs.reportdir}/${findbugs.raw}"
|
||||
jvmargs="${findbugs.jvmargs}"
|
||||
projectName="${Name} ${project.version}">
|
||||
<class location="${core.classes.build.dir}" />
|
||||
<sourcePath path="${src.dir}" />
|
||||
</fb:findbugs>
|
||||
|
||||
<!-- Generate (human) readable output -->
|
||||
<xslt basedir="${findbugs.reportdir}" includes="${findbugs.raw}" destdir="${findbugs.reportdir}">
|
||||
<style>
|
||||
<javaresource name="${findbugs.xsl}" classpathref="findbugs.real.classpath"/>
|
||||
</style>
|
||||
</xslt>
|
||||
</target>
|
||||
|
||||
<!-- =================================================================
|
||||
IDE SPECIFIC
|
||||
================================================================= -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue