When this task executes, it will recursively scan the sourcedir and destdir looking for Java source files to compile. This task makes its compile decision based on timestamp.
Attribute | Description | Type | Required? |
target | Sets the target VM that the classes will be compiled for. Valid values depend on the compiler, for jdk 1.4 the valid values are "1.1", "1.2", "1.3", "1.4" and "1.5". | String | ? |
excludes | String | ? | |
verbose | If true, asks the compiler for verbose output. | boolean | ? |
bootclasspathref | Adds a reference to a classpath defined elsewhere. | Reference | ? |
compiler | Choose the implementation for this particular task. | String | ? |
executable |
Sets the name of the javac executable.
Ignored unless fork is true or extJavac has been specified as the compiler. |
String | ? |
debuglevel | Keyword list to be appended to the -g command-line switch. This will be ignored by all implementations except modern and classic(ver >= 1.2). Legal values are none or a comma-separated list of the following keywords: lines, vars, and source. If debuglevel is not specified, by default, :none will be appended to -g. If debug is not turned on, this attribute will be ignored. | String | ? |
memoryinitialsize | The initial size of the memory for the underlying VM if javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m) | String | ? |
deprecation | Indicates whether source should be compiled with deprecation information; defaults to off. | boolean | ? |
includeantruntime | If true, includes Ant's own classpath in the classpath. | boolean | ? |
sourcepathref | Adds a reference to a source path defined elsewhere. | Reference | ? |
depend | Enables dependency-tracking for compilers that support this (jikes and classic). | boolean | ? |
includes | String | ? | |
source | Value of the -source command-line switch; will be ignored by all implementations except modern and jikes. If you use this attribute together with jikes, you must make sure that your version of jikes supports the -source switch. Legal values are 1.3, 1.4 and 1.5 - by default, no -source argument will be used at all. | String | ? |
includejavaruntime | If true, includes the Java runtime libraries in the classpath. | boolean | ? |
failonerror | Indicates whether the build will continue even if there are compilation errors; defaults to true. | boolean | ? |
destdir | Set the destination directory into which the Java source files should be compiled. | File | ? |
debug | Indicates whether source should be compiled with debug information; defaults to off. | boolean | ? |
tempdir | Where Ant should place temporary files. | File | ? |
classpath | Set the classpath to be used for this compilation. | Path | ? |
followsymlinks | boolean | ? | |
casesensitive | boolean | ? | |
defaultexcludes | boolean | ? | |
bootclasspath | Sets the bootclasspath that will be used to compile the classes against. | Path | ? |
includesfile | File | ? | |
nowarn | If true, enables the -nowarn option. | boolean | ? |
proceed | boolean | ? | |
classpathref | Adds a reference to a classpath defined elsewhere. | Reference | ? |
fork | If true, forks the javac compiler. | boolean | ? |
srcdir | Set the source directories to find the source Java files. | Path | ? |
memorymaximumsize | The maximum size of the memory for the underlying VM if javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m) | String | ? |
optimize | If true, compiles with optimization enabled. | boolean | ? |
encoding | Set the Java source file encoding name. | String | ? |
excludesfile | File | ? | |
sourcepath | Set the sourcepath to be used for this compilation. | Path | ? |
listfiles | If true, list the source files being handed off to the compiler. | boolean | ? |
extdirs | Sets the extension directories that will be used during the compilation. | Path | ? |
Moved out of MatchingTask to make it a standalone object that could be referenced (by scripts for example).
Attribute | Description | Type | Required |
includes |
Appends includes to the current list of include patterns.
Patterns may be separated by a comma or a space.
|
String | ? |
refid |
Makes this instance in effect a reference to another PatternSet
instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
excludesfile | Sets the name of the file containing the excludes patterns. | File | ? |
includesfile | Sets the name of the file containing the includes patterns. | File | ? |
excludes |
Appends excludes to the current list of exclude patterns.
Patterns may be separated by a comma or a space.
|
String | ? |
Attribute | Description | Type | Required |
name | Sets the name pattern. | String | ? |
unless | Sets the unless attribute. This attribute and the "if" attribute are used to validate the name, based in the existence of the property. | String | ? |
if | Sets the if attribute. This attribute and the "unless" attribute are used to validate the name, based in the existence of the property. | String | ? |
Attribute | Description | Type | Required |
name | Sets the name pattern. | String | ? |
unless | Sets the unless attribute. This attribute and the "if" attribute are used to validate the name, based in the existence of the property. | String | ? |
if | Sets the if attribute. This attribute and the "unless" attribute are used to validate the name, based in the existence of the property. | String | ? |
Attribute | Description | Type | Required |
classpath | Set the classpath to load the classname specified using an attribute. | Path | ? |
error | String | ? | |
classpathref | Set the classpath to use for loading a custom selector by using a reference. | Reference | ? |
refid | Reference | ? | |
classname | Sets the classname of the custom selector. | String | ? |
Attribute | Description | Type | Required |
error | String | ? | |
targetdir | The name of the file or directory which is checked for matching files. | File | ? |
refid | Reference | ? | |
present |
This sets whether to select a file if its dest file is present.
It could be a negate boolean, but by doing things
this way, we get some documentation on how the system works.
A user looking at the documentation should clearly understand
that the ONLY files whose presence is being tested are those
that already exist in the source directory, hence the lack of
a destonly option.
|
String ["srconly", "both"] | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? |
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
Attribute | Description | Type | Required |
refid |
Makes this instance in effect a reference to another Path instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
path | Parses a path definition and creates single PathElements. | String | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? | |
type | Set the type of file to require. | String ["file", "dir"] | ? |
Selector class that uses Algorithm, Cache and Comparator for its work. The Algorithm is used for computing a hashvalue for a file. The Comparator decides whether to select or not. The Cache stores the other value for comparison by the Comparator in a persistent manner.
The ModifiedSelector is implemented as a CoreSelector and uses default values for all its attributes therefore the simpliest example is
The same example rewritten as CoreSelector with setting the all values (same as defaults are) would be
And the same rewritten as CustomSelector would be
All these three examples copy the files from src to dest using the ModifiedSelector. The ModifiedSelector uses the PropertyfileCache , the DigestAlgorithm and the EqualComparator for its work. The PropertyfileCache stores key-value-pairs in a simple java properties file. The filename is cache.properties. The update flag lets the selector update the values in the cache (and on first call creates the cache). The DigestAlgorithm computes a hashvalue using the java.security.MessageDigest class with its MD5-Algorithm and its standard provider. The new computed hashvalue and the stored one are compared by the EqualComparator which returns 'true' (more correct a value not equals zero (1)) if the values are not the same using simple String comparison.
A useful scenario for this selector is inside a build environment for homepage generation (e.g. with Apache Forrest).
Here all changed files are uploaded to the server. The ModifiedSelector saves therefore much upload time.generate the site using forrest upload the changed files
This selector supports the following nested param's:
name | values | description | required |
---|---|---|---|
cache | propertyfile | which cache implementation should be used
|
no, defaults to 'propertyfile' |
algorithm | hashvalue | digest | which algorithm implementation should be used
|
no, defaults to digest |
comparator | equal | role | which comparator implementation should be used
|
no, defaults to equal |
update | true | false | If set to true, the cache will be stored, otherwise the values will be lost. | no, defaults to true |
seldirs | true | false | If set to true, directories will be selected otherwise not | no, defaults to true |
cache.* | depends on used cache | value is stored and given to the Cache-Object for initialisation | depends on used cache |
algorithm.* | depends on used algorithm | value is stored and given to the Algorithm-Object for initialisation | depends on used algorithm |
comparator.* | depends on used comparator | value is stored and given to the Comparator-Object for initialisation | depends on used comparator |
This selector uses reflection for setting the values of its three interfaces (using org.apache.tools.ant.IntrospectionHelper) therefore no special 'configuration interfaces' has to be implemented by new caches, algorithms or comparators. All present setXX methods can be used. E.g. the DigestAlgorithm can use a specified provider for computing its value. For selecting this there is a setProvider(String providername) method. So you can use a nested .
Attribute | Description | Type | Required |
comparator | String ["equal", "rule"] | ? | |
seldirs | Support for seldirs attribute. | boolean | ? |
algorithm | String ["hashvalue", "digest"] | ? | |
cache | String ["propertyfile"] | ? | |
error | String | ? | |
refid | Reference | ? | |
update | Support for update attribute. | boolean | ? |
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
Attribute | Description | Type | Required |
refid |
Makes this instance in effect a reference to another Path instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
path | Parses a path definition and creates single PathElements. | String | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? |
Attribute | Description | Type | Required |
error | String | ? | |
casesensitive | Whether to ignore case in the string being searched. | boolean | ? |
refid | Reference | ? | |
ignorewhitespace | Whether to ignore whitespace in the string being searched. | boolean | ? |
text | The string to search for within a file. | String | ? |
Attribute | Description | Type | Required |
error | String | ? | |
targetdir | File | ? | |
refid | Reference | ? | |
granularity | int | ? |
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
Attribute | Description | Type | Required |
refid |
Makes this instance in effect a reference to another Path instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
path | Parses a path definition and creates single PathElements. | String | ? |
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
Attribute | Description | Type | Required |
refid |
Makes this instance in effect a reference to another Path instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
path | Parses a path definition and creates single PathElements. | String | ? |
This is a useful selector to work with programs and tasks that don't handle dependency checking properly; Even if a predecessor task always creates its output files, followup tasks can be driven off copies made with a different selector, so their dependencies are driven on the absolute state of the files, not a timestamp.
Clearly, however, bulk file comparisons is inefficient; anything that can use timestamps is to be preferred. If this selector must be used, use it over as few files as possible, perhaps following it with an <uptodate;> to keep the descendent routines conditional.
Attribute | Description | Type | Required |
ignorecontents | This flag tells the selector to ignore contents | boolean | ? |
error | String | ? | |
targetdir | File | ? | |
refid | Reference | ? | |
ignorefiletimes | This flag tells the selector to ignore file times in the comparison | boolean | ? |
granularity | int | ? |
Attribute | Description | Type | Required |
when | This specifies when the file should be selected, whether it be when the file matches a particular size, when it is smaller, or whether it is larger. | String ["less", "more", "equal"] | ? |
units |
Sets the units to use for the comparison. This is a little
complicated because common usage has created standards that
play havoc with capitalization rules. Thus, some people will
use "K" for indicating 1000's, when the SI standard calls for
"k". Others have tried to introduce "K" as a multiple of 1024,
but that falls down when you reach "M", since "m" is already
defined as 0.001.
To get around this complexity, a number of standards bodies have proposed the 2^10 standard, and at least one has adopted it. But we are still left with a populace that isn't clear on how capitalization should work. We therefore ignore capitalization as much as possible. Completely mixed case is not possible, but all upper and lower forms are accepted for all long and short forms. Since we have no need to work with the 0.001 case, this practice works here. This function translates all the long and short forms that a unit prefix can occur in and translates them into a single multiplier. |
String ["K", "k", "kilo", "KILO", "Ki", "KI", "ki", "kibi", "KIBI", "M", "m", "mega", "MEGA", "Mi", "MI", "mi", "mebi", "MEBI", "G", "g", "giga", "GIGA", "Gi", "GI", "gi", "gibi", "GIBI", "T", "t", "tera", "TERA", "Ti", "TI", "ti", "tebi", "TEBI"] | ? |
error | String | ? | |
refid | Reference | ? | |
value | A size selector needs to know what size to base its selecting on. This will be further modified by the multiplier to get an actual size limit. | long | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? | |
allowtie | A attribute to specify what will happen if number of yes votes is the same as the number of no votes defaults to true | boolean | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? | |
expression | The regular expression used to search the file. | String | ? |
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
Attribute | Description | Type | Required |
refid |
Makes this instance in effect a reference to another Path instance.
You must not set another attribute or nest elements inside this element if you make it a reference. |
Reference | ? |
path | Parses a path definition and creates single PathElements. | String | ? |
Attribute | Description | Type | Required |
error | String | ? | |
casesensitive | Whether to ignore case when checking filenames. | boolean | ? |
name | The name of the file, or the pattern for the name, that should be used for selection. | String | ? |
refid | Reference | ? | |
negate | You can optionally reverse the selection of this selector, thereby emulating an <exclude> tag, by setting the attribute negate to true. This is identical to surrounding the selector with <not></not>. | boolean | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? | |
unless | Sets the unless attribute to a property which cannot exist for the selector to select any files. | String | ? |
if | Sets the if attribute to a property which must exist for the selector to select any files. | String | ? |
Attribute | Description | Type | Required |
name | Sets the name pattern. | String | ? |
unless | Sets the unless attribute. This attribute and the "if" attribute are used to validate the name, based in the existence of the property. | String | ? |
if | Sets the if attribute. This attribute and the "unless" attribute are used to validate the name, based in the existence of the property. | String | ? |
Attribute | Description | Type | Required |
line | String | ? | |
implementation | String | ? | |
file | File | ? | |
compiler | String | ? | |
pathref | Reference | ? | |
value | String | ? | |
path | Path | ? |
Attribute | Description | Type | Required |
refid | Reference | ? | |
millis | For users that prefer to express time in milliseconds since 1970 | long | ? |
checkdirs | Should we be checking dates on directories? | boolean | ? |
datetime | Sets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM format | String | ? |
granularity | Sets the number of milliseconds leeway we will give before we consider a file not to have matched a date. | int | ? |
pattern | Sets the pattern to be used for the SimpleDateFormat | String | ? |
when | Sets the type of comparison to be done on the file's last modified date. | String ["before", "after", "equal"] | ? |
error | String | ? |
Attribute | Description | Type | Required |
name | Sets the name pattern. | String | ? |
unless | Sets the unless attribute. This attribute and the "if" attribute are used to validate the name, based in the existence of the property. | String | ? |
if | Sets the if attribute. This attribute and the "unless" attribute are used to validate the name, based in the existence of the property. | String | ? |
Attribute | Description | Type | Required |
max | The minimum depth below the basedir before a file is selected. | int | ? |
error | String | ? | |
min | The minimum depth below the basedir before a file is selected. | int | ? |
refid | Reference | ? |
Attribute | Description | Type | Required |
error | String | ? | |
refid | Reference | ? |