ICU-8924 Add findbugs targets

X-SVN-Rev: 31176
This commit is contained in:
Abhinav Gupta 2011-12-29 18:13:00 +00:00
parent 2f5489adb1
commit 2730ee27c3
11 changed files with 100 additions and 2 deletions

View file

@ -116,6 +116,8 @@
<target name="tests" depends="info, core-tests, charset-tests, collate-tests, packaging-tests, translit-tests, localespi-tests" description="Build ICU4J test classes"/>
<target name="release" depends="info, releaseBinaries, releaseSrcJars, releaseDocs, releaseSourceArchiveTgz" description="Build all ICU4J release files for distribution"/>
<target name="findbugs" depends="charset-findbugs, collate-findbugs, core-findbugs, currdata-findbugs, langdata-findbugs, localespi-findbugs, regiondata-findbugs, translit-findbugs" description="Run FindBugs on all projects." />
<target name="secure" depends="icu4jJar" description="(Deprecated)Build ICU4J API and test classes for running the ICU4J test suite with Java security manager enabled"/>
<!-- Check to see if JVM_OPTIONS enviroment variable is set. This can be use to set the heap size. -->
@ -497,6 +499,40 @@
<delete file="${icu4jsrc.tar}"/>
</target>
<!-- findbugs targets -->
<target name="core-findbugs" description="Find bugs in core">
<ant dir="${icu4j.core.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="collate-findbugs" description="Find bugs in collate">
<ant dir="${icu4j.collate.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="charset-findbugs" description="Find bugs in charset">
<ant dir="${icu4j.charset.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="currdata-findbugs" description="Find bugs in currdata">
<ant dir="${icu4j.currdata.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="langdata-findbugs" description="Find bugs in langdata">
<ant dir="${icu4j.langdata.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="localespi-findbugs" description="Find bugs in localespi">
<ant dir="${icu4j.localespi.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="regiondata-findbugs" description="Find bugs in regiondata">
<ant dir="${icu4j.regiondata.dir}" inheritAll="false" target="findbugs" />
</target>
<target name="translit-findbugs" description="Find bugs in translit">
<ant dir="${icu4j.translit.dir}" inheritAll="false" target="findbugs" />
</target>
<!-- compile targets -->
<target name="core" description="Build core classes">
<ant dir="${icu4j.core.dir}" inheritAll="false"/>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU core data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset>
@ -38,4 +40,4 @@
</unjar>
</target>
</project>
</project>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU collation data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset includes="${icu4j.data.path}/coll/**"/>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU core data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU currency data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset includes="${icu4j.data.path}/curr/**"/>

View file

@ -30,6 +30,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU language data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset includes="${icu4j.data.path}/lang/**"/>

View file

@ -28,4 +28,6 @@
<target name="jar" depends="compile, copy, @jar" description="Create the project's jar file"/>
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
</project>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
</project>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU region data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset includes="${icu4j.data.path}/region/**"/>

View file

@ -29,6 +29,8 @@
<target name="src-jar" depends="@src-jar" description="Create the project's source jar file"/>
<target name="findbugs" depends="@findbugs" description="Search the project for possible defects using FindBugs." />
<target name="copy-data" description="Extract pre-built ICU transliteration data files and copy them to the project's binary directory">
<unjar src="${icu4j.data.jar}" dest="${bin.dir}">
<patternset includes="${icu4j.data.path}/translit/**"/>

View file

@ -106,6 +106,49 @@
<echo message="${full.locale.names}" file="${res.dir}/fullLocaleNames.lst"/>
</target>
<!-- fail if findbugs.home is not given or the findbugs task is
unavailable -->
<target name="_findbugs_check">
<fail message="findbugs.home must be defined.">
<condition>
<not>
<available file="${findbugs.home}" type="dir" />
</not>
</condition>
</fail>
<fail message="FindBugs task not found">
<condition>
<not>
<or>
<available classname="edu.umd.cs.findbugs.anttask.FindBugsTask" property="_findbugs.task.available" />
<available file="${findbugs.home}/lib/findbugs-ant.jar" />
</or>
</not>
</condition>
</fail>
</target>
<!-- if findbugs-ant.jar is already on the path, just define the task -->
<target name="_findbugs_task_available" depends="_findbugs_check" if="_findbugs.task.available">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
</target>
<!-- otherwise, specify findbugs-ant.jar on the path -->
<target name="_findbugs_task_unavailable" depends="_findbugs_check" unless="_findbugs.task.available">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpath="${findbugs.home}/lib/findbugs-ant.jar" />
</target>
<target name="_findbugs_task" depends="_findbugs_task_available, _findbugs_task_unavailable" />
<target name="@findbugs" depends="_findbugs_task, @build-all">
<findbugs home="${findbugs.home}" output="html" outputFile="${out.dir}/fb-${ant.project.name}.html">
<sourcePath path="${src.dir}" />
<class location="${jar.dir}/${jar.name}" />
<auxClasspath path="${toString:javac.classpathref}" />
</findbugs>
</target>
<!-- Dependencies -->
<!-- collate -->

View file

@ -62,3 +62,6 @@ icu4j.samples.jar = ${icu4j.samples.dir}/${jar.dir}/icu4j-samples.jar
# Misc
icu4j.data.path = com/ibm/icu/impl/data/icudt${icu4j.data.version}b
# Findbugs
findbugs.home =