Usage

The Jalopy task can take a few parameters to control the runtime behavior of Jalopy. If omitted, your current code convention settings will be used.

Nested <fileset> elements can and should be used to specify the source files and/or directories. You can also set user enironment variables for a run by using nested <variable> elements (See example below).

Parameters

The valid parameters are listed in the table below.

Table 4.1. Jalopy Ant task parameters

AttributeTypeDescriptionSinceRequired
backupBoolean Sets whether backup copies of all processed Java source files should be kept. If omitted, the corresponding code convention setting will be used (see the section called "Backup"). 1.0No
classpathrefString The classpath to setup the type repository with, given as a reference to a path defined elsewhere. If you want the import optimization or Insert Serial Version UID features to work, you have to specify the classpath reference you use to compile your sources here.

The referenced path must contain all types that are needed by your project. Specifying the Java runtime classes is optional; if they are omitted, the runtime classes used by Ant will be automatically added.

1.0No
conventionString Sets the location to the code convention file to use - given either relative to the project's base directory or as an absolute local path or internet address (refer to the section called "Importing" for information how to export your settings). If omitted, the current settings are used, if available. Otherwise the Jalopy build-in defaults will be used. 1.0No
destdirString Sets the destination directory to create/copy all formatting output into. If the given directory does not exist, it will be created. If omitted, all input files will simply be overridden. 1.0No
encodingString Sets the encoding that controls how Jalopy interprets text files containing characters beyond the ASCII character set. Defaults to the platform default encoding. 1.0No
failonerrorBoolean Sets whether a run should be held if errors occurred. Defaults to "true". 1.0No
fileStringSpecifies a single source file to format.1.0Yes, if no fileset is specified
fileformatStringSets the file format of the output files. The file format controls what end of line character is used. Either one of "UNIX", "DOS", "DEFAULT" or "AUTO" can be used (case insensitive). Defaults to "AUTO". 1.0No
forceBooleanSets whether the formatting of files should be forced, even if a file is up-to-date. Defaults to "false". 1.0No
forkBooleanSets whether the processing should be performed in a separate VM. Defaults to "false". 1.0No
historyString Sets the history policy to use. Either one of "ADLER32", "CRC32" or "NONE" can be used (case insensitive). If omitted, the corresponding code convention setting will used (see the section called "History"). 1.0.3No
historyMethodStringDEPRECATED. Same as history, see explanation there.1.0No
inputEncodingString Sets the character encoding that controls how Jalopy interprets input text files containing characters beyond the ASCII character set. Defaults to the platform default encoding. Please note that this setting always overrides encoding. 1.6No
javadocStringIndicates whether Javadoc related messages should be printed. Defaults to "true". 1.0No
loglevelStringSpecifies the logging level for message output. Either one of "ERROR", "WARN", "INFO" or "DEBUG" can be used (case insensitive). If omitted, the current code convention settings will be used (see the section called "Categories"). 1.0No
logString Specifies the log file to use for logging output. The format of the logging output is determined by the extension of the given file. Valid extensions are .log for a custom plain text format, .xml for a plain XML format and .html for an hierarchial HTML report. If omitted, the current code convention setting will be used (see the section called "Logging"). 1.0.3No
outputEncodingString Sets the character encoding Jalopy uses to write files. Defaults to the platform default encoding. Please note that this setting always overrides encoding. 1.6No
profileString Sets the Jalopy profile that should be activated during the formatting run. (refer to the section called "Main window" for more information about profiles) The currently active profile will be restored after formatting. Please note that the profile must exist! 1.5No
projectStringDEPRECATED. Same as profile, see explanation there. 1.1No
repositoryBooleanIndicates whether the type repository should be used for type lookup. When disabled, this currently means that all dependent features despite the import optimization will be disabled! Only meaningful if classpathref has been set. You may want to use this option if you commonly format a single file or only a sets of files in order to avoid the maintenance overhead of the type repository. Defaults to "true". 1.6No
styleStringDEPRECATED. Same as convention, see explanation there.1.0No
testBooleanSets whether formatting output should actually be written to disk. If set to "true" no output will be written to disk. The default is "false". 1.0No
threadsIntegerSpecifies the number of processing threads to use. Integer between 1 - 8. If omitted, the current code convention setting will be used. 1.0No