Ant Task

<pretty/> simply gives you the chance to integrate source-beautification on selected source files into your build process. It's great tool for teams that work on open source projects. The coding convention is defined in a pretty.settings file and <pretty/> task defined before the compile target. <pretty/> is smart enough not to reformat unmodified code if cvs="true" parameter specified and using CVS as the source control system. It also does not try to beautify if the compiled form source file is older than source file.

Parameters

Attribute Description Required
settingsdir Directory where JavaStyle settings are placed. Under this directory a ".Refactory" sub-directory holds the style settings. Yes
cvs If true then try to beautify only files that are either new or modified in CVS, do not try to reformat something not modified by current user, so the file is not modified unnecessarily. No, default is false
compileDir If set to a directory then try to beautify only files that are modified after the last compile. No, default is don't try and beautify files after compile.
timeZone time zone for the comparison of modification times between that in CVS and the current version. This is required to handle dayslight saving time among other times. No, defaults to GMT

Usage example

<taskdef name="pretty" classname="org.acm.seguin.ant.Pretty" classpath="lib/pretty.jar;lib/JavaStyle.jar"/> timeZone="GMT"

<pretty settingsDir="${my.config.dir}" cvs="true" compileDir="${build.dir}/classes">
	<fileset dir="${src.dir}">
		<include name="**/*.java" />
	</fileset>
</pretty>

Last Modified: 30 October 2003