make/build.xml

changeset 1137
c1238fcc9515
parent 1045
18002d039806
child 1194
2360c8213989
equal deleted inserted replaced
1136:ae361e7f435a 1137:c1238fcc9515
129 <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/> 129 <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
130 <property name="dist.dir" location="dist"/> 130 <property name="dist.dir" location="dist"/>
131 <property name="dist.bin.dir" location="${dist.dir}/bin"/> 131 <property name="dist.bin.dir" location="${dist.dir}/bin"/>
132 <property name="dist.coverage.dir" location="${dist.dir}/coverage"/> 132 <property name="dist.coverage.dir" location="${dist.dir}/coverage"/>
133 <property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/> 133 <property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/>
134 <property name="dist.checkstyle.dir" location="${dist.dir}/checkstyle"/>
134 <property name="dist.lib.dir" location="${dist.dir}/lib"/> 135 <property name="dist.lib.dir" location="${dist.dir}/lib"/>
135 <property name="make.dir" location="make"/> 136 <property name="make.dir" location="make"/>
137 <property name="make.conf.dir" location="${make.dir}/conf"/>
136 <property name="make.tools.dir" location="${make.dir}/tools"/> 138 <property name="make.tools.dir" location="${make.dir}/tools"/>
137 <property name="src.dir" location="src"/> 139 <property name="src.dir" location="src"/>
138 <property name="src.bin.dir" location="${src.dir}/share/bin"/> 140 <property name="src.bin.dir" location="${src.dir}/share/bin"/>
139 <property name="src.classes.dir" location="${src.dir}/share/classes"/> 141 <property name="src.classes.dir" location="${src.dir}/share/classes"/>
140 <property name="test.dir" location="test"/> 142 <property name="test.dir" location="test"/>
261 263
262 <target name="jtreg" depends="build-all-tools,-def-jtreg"> 264 <target name="jtreg" depends="build-all-tools,-def-jtreg">
263 <jtreg-tool name="all" tests="${jtreg.tests}"/> 265 <jtreg-tool name="all" tests="${jtreg.tests}"/>
264 </target> 266 </target>
265 267
268 <target name="checkstyle" depends="-def-checkstyle"
269 description="Generates reports for code convention violations.">
270 <mkdir dir="${dist.checkstyle.dir}"/>
271 <checkstyle config="${make.conf.dir}/checkstyle-langtools.xml"
272 failureProperty="checkstyle.failure"
273 failOnViolation="false">
274 <formatter type="xml" tofile="${dist.checkstyle.dir}/checkstyle_report.xml"/>
275 <fileset dir="src" includes="**/*.java, **/*.properties"/>
276 </checkstyle>
277 <!-- transform the output to a simple html -->
278 <xslt in="${dist.checkstyle.dir}/checkstyle_report.xml"
279 out="${dist.checkstyle.dir}/checkstyle_report.html"
280 style="${checkstyle.home}/contrib/checkstyle-simple.xsl"/>
281 <!-- transform the output to a very simple emacs friendly text file -->
282 <xslt in="${dist.checkstyle.dir}/checkstyle_report.xml"
283 out="${dist.checkstyle.dir}/checkstyle_report.tmp"
284 style="${make.conf.dir}/checkstyle-emacs.xsl"/>
285 <!-- beautify remove extra lines -->
286 <move file="${dist.checkstyle.dir}/checkstyle_report.tmp"
287 toFile="${dist.checkstyle.dir}/checkstyle_report.emacs.txt">
288 <filterchain>
289 <ignoreblank/>
290 <replaceregex byline="true" pattern="^File:" replace="${line.separator}File:"/>
291 </filterchain>
292 </move>
293 </target>
294 <!-- target can be invoked from an ide, the output of which can be used
295 to access and fix the errors directly.
296 -->
297 <target name="checkstyle-ide" depends="checkstyle">
298 <concat>
299 <fileset file="${dist.checkstyle.dir}/checkstyle_report.emacs.txt"/>
300 </concat>
301 </target>
302
266 <target name="findbugs" depends="-def-findbugs,build-all-tools"> 303 <target name="findbugs" depends="-def-findbugs,build-all-tools">
267 <property name="findbugs.reportLevel" value="medium"/> 304 <property name="findbugs.reportLevel" value="medium"/>
268 <mkdir dir="${dist.findbugs.dir}"/> 305 <mkdir dir="${dist.findbugs.dir}"/>
269 <findbugs 306 <findbugs
270 home="${findbugs.home}" 307 home="${findbugs.home}"
404 <echo level="info">ant.home = ${ant.home}</echo> 441 <echo level="info">ant.home = ${ant.home}</echo>
405 <echo level="info">boot.java.home = ${boot.java.home}</echo> 442 <echo level="info">boot.java.home = ${boot.java.home}</echo>
406 <echo level="info">target.java.home = ${target.java.home}</echo> 443 <echo level="info">target.java.home = ${target.java.home}</echo>
407 <echo level="info">jtreg.home = ${jtreg.home}</echo> 444 <echo level="info">jtreg.home = ${jtreg.home}</echo>
408 <echo level="info">findbugs.home = ${findbugs.home}</echo> 445 <echo level="info">findbugs.home = ${findbugs.home}</echo>
446 <echo level="info">checkstyle.home = ${checkstyle.home}</echo>
409 </target> 447 </target>
410 448
411 <target name="post-sanity" depends="-def-jtreg,sanity,build" 449 <target name="post-sanity" depends="-def-jtreg,sanity,build"
412 description="perform basic validation after a standard build"> 450 description="perform basic validation after a standard build">
413 <jtreg 451 <jtreg
688 726
689 <target name="-check-findbugs.home" depends="-def-check"> 727 <target name="-check-findbugs.home" depends="-def-check">
690 <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/> 728 <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/>
691 </target> 729 </target>
692 730
731 <target name="-check-checkstyle.home" depends="-def-check">
732 <check name="checkstyle" property="checkstyle.home" marker="${checkstyle.name.version}.jar"/>
733 </target>
734
693 <target name="-check-jtreg.home" depends="-def-check"> 735 <target name="-check-jtreg.home" depends="-def-check">
694 <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/> 736 <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
695 </target> 737 </target>
696 738
697 <target name="-check-vizant" depends="-def-check"> 739 <target name="-check-vizant" depends="-def-check">
987 </fileset> 1029 </fileset>
988 </path> 1030 </path>
989 <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/> 1031 <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
990 </target> 1032 </target>
991 1033
1034 <target name="-def-checkstyle" unless="checkstyle.defined"
1035 depends="-check-checkstyle.home">
1036 <taskdef resource="checkstyletask.properties">
1037 <classpath>
1038 <pathelement location="${checkstyle.home}/${checkstyle.name.version}-all.jar"/>
1039 </classpath>
1040 </taskdef>
1041 <property name="checkstyle.defined" value="true"/>
1042 </target>
1043
992 <target name="-def-findbugs" unless="findbugs.defined" 1044 <target name="-def-findbugs" unless="findbugs.defined"
993 depends="-check-findbugs.home,-check-target.java.home"> 1045 depends="-check-findbugs.home,-check-target.java.home">
994 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> 1046 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
995 <classpath> 1047 <classpath>
996 <pathelement location="${findbugs.home}/lib/findbugs.jar"/> 1048 <pathelement location="${findbugs.home}/lib/findbugs.jar"/>

mercurial