Rmic can be run on a single class (as specified with the classname
attribute) or a number of classes at once (all classes below base that
are neither _Stub nor _Skel classes). If you want to rmic a single
class and this class is a class nested into another class, you have to
specify the classname in the form Outer$$Inner
instead of
Outer.Inner
.
It is possible to refine the set of files that are being rmiced. This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes attributes. With the includes or includesfile attribute you specify the files you want to have included by using patterns. The exclude or excludesfile attribute is used to specify the files you want to have excluded. This is also done with patterns. And finally with the defaultexcludes attribute, you can specify whether you want to use default exclusions or not. See the section on directory based tasks, on how the inclusion/exclusion of files works, and how to write patterns.
This task forms an implicit FileSet and
supports all attributes of <fileset>
(dir
becomes base
) as well as the nested
<include>
, <exclude>
and
<patternset>
elements.
It is possible to use different compilers. This can be selected
with the "build.rmic" property or the compiler
attribute. There are three choices:
The miniRMI project contains a compiler implementation for this task as well, please consult miniRMI's documentation to learn how to use it.
Attribute | Description | Type | Required? |
verify | Flag to enable verification so that the classes found by the directory match are checked to see if they implement java.rmi.Remote. optional; This defaults to false if not set. | boolean | ? |
excludes | String | ? | |
iiop | Indicates that IIOP compatible stubs should be generated; optional, defaults to false if not set. | boolean | ? |
idlopts | pass additional arguments for IDL compile | String | ? |
extdirs | Sets the extension directories that will be used during the compilation; optional. | Path | ? |
sourcebase | optional directory to save generated source files to. | File | ? |
classpathref | Adds to the classpath a reference to a <path> defined elsewhere. | Reference | ? |
base | Sets the location to store the compiled files; required | File | ? |
defaultexcludes | boolean | ? | |
followsymlinks | boolean | ? | |
includeantruntime |
Sets whether or not to include ant's own classpath in this task's
classpath.
Optional; default is true .
|
boolean | ? |
includejavaruntime | task's classpath. Enables or disables including the default run-time libraries from the executing VM; optional, defaults to false | boolean | ? |
classpath | Set the classpath to be used for this compilation. | Path | ? |
casesensitive | boolean | ? | |
debug | Generate debug info (passes -g to rmic); optional, defaults to false | boolean | ? |
compiler |
Sets the compiler implementation to use; optional,
defaults to the value of the build.rmic property,
or failing that, default compiler for the current VM
|
String | ? |
includes | String | ? | |
includesfile | File | ? | |
idl | Indicates that IDL output should be generated. This defaults to false if not set. | boolean | ? |
iiopopts | Set additional arguments for iiop | String | ? |
classname |
Sets the class to run rmic against;
optional
|
String | ? |
excludesfile | File | ? | |
filtering | Sets token filtering [optional], default=false | boolean | ? |
stubversion | Specify the JDK version for the generated stub code. Specify "1.1" to pass the "-v1.1" option to rmic. | String | ? |
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 | ? |
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 | ? |
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 | ? |
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 | Only pass the specified argument if the chosen compiler implementation matches the value of this attribute. Legal values are the same as those in the above list of valid compilers.) | 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 | ? |