Runs the rmic compiler against classes.
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:
- sun (the standard compiler of the JDK)
- kaffe (the standard compiler of
Kaffe
)
- weblogic
The
miniRMI
project contains a compiler implementation for this task as well,
please consult miniRMI's documentation to learn how to use it.
createClasspath
public Path createClasspath()
Creates a nested classpath element.
createExtdirs
public Path createExtdirs()
Maybe creates a nested extdirs element.
execute
public void execute()
throws BuildException
execute by creating an instance of an implementation
class and getting to do the work
- execute in interface Task
getBase
public File getBase()
Gets the base directory to output generated class.
getClassname
public String getClassname()
Gets the class name to compile.
getClasspath
public Path getClasspath()
Gets the classpath.
getCompileList
public Vector getCompileList()
getCompiler
public String getCompiler()
get the name of the current compiler
- Ant 1.5
getCurrentCompilerArgs
public String[] getCurrentCompilerArgs()
Get the additional implementation specific command line arguments.
- array of command line arguments, guaranteed to be non-null.
- Ant 1.5
getDebug
public boolean getDebug()
Gets the debug flag.
getExtdirs
public Path getExtdirs()
Gets the extension directories that will be used during the
compilation.
getFileList
public Vector getFileList()
Gets file list to compile.
getFiltering
public boolean getFiltering()
getIdl
public boolean getIdl()
Gets IDL flags.
getIdlopts
public String getIdlopts()
Gets additional arguments for idl compile.
getIiop
public boolean getIiop()
Gets iiop flags.
getIiopopts
public String getIiopopts()
Gets additional arguments for iiop.
getIncludeantruntime
public boolean getIncludeantruntime()
Gets whether or not the ant classpath is to be included in the
task's classpath.
getIncludejavaruntime
public boolean getIncludejavaruntime()
Gets whether or not the java runtime should be included in this
task's classpath.
getLoader
public ClassLoader getLoader()
Classloader for the user-specified classpath.
getRemoteInterface
public Class getRemoteInterface(Class testClass)
Returns the topmost interface that extends Remote for a given
class - if one exists.
getSourceBase
public File getSourceBase()
Gets the source dirs to find the source java files.
getStubVersion
public String getStubVersion()
getVerify
public boolean getVerify()
Get verify flag.
isValidRmiRemote
public boolean isValidRmiRemote(String classname)
Load named class and test whether it can be rmic'ed
scanDir
protected void scanDir(File baseDir,
String[] files,
FileNameMapper mapper)
Scans the directory looking for class files to be compiled.
The result is returned in the class variable compileList.
setBase
public void setBase(File base)
Sets the location to store the compiled files; required
setClassname
public void setClassname(String classname)
Sets the class to run rmic
against;
optional
setClasspath
public void setClasspath(Path classpath)
Set the classpath to be used for this compilation.
setClasspathRef
public void setClasspathRef(Reference r)
Adds to the classpath a reference to
a <path> defined elsewhere.
setCompiler
public void setCompiler(String 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
- Ant 1.5
setDebug
public void setDebug(boolean debug)
generate debug info (passes -g to rmic);
optional, defaults to false
setExtdirs
public void setExtdirs(Path extdirs)
Sets the extension directories that will be used during the
compilation; optional.
setFiltering
public void setFiltering(boolean filter)
indicates whether token filtering should take place;
optional, default=false
setIdl
public void setIdl(boolean idl)
Indicates that IDL output should be
generated. This defaults to false
if not set.
setIdlopts
public void setIdlopts(String idlopts)
pass additional arguments for idl compile
setIiop
public void setIiop(boolean iiop)
Indicates that IIOP compatible stubs should
be generated; optional, defaults to false
if not set.
setIiopopts
public void setIiopopts(String iiopopts)
Set additional arguments for iiop
setIncludeantruntime
public void setIncludeantruntime(boolean include)
Sets whether or not to include ant's own classpath in this task's
classpath.
Optional; default is true
.
setIncludejavaruntime
public void setIncludejavaruntime(boolean include)
task's classpath.
Enables or disables including the default run-time
libraries from the executing VM; optional,
defaults to false
setSourceBase
public void setSourceBase(File sourceBase)
optional directory to save generated source files to.
setStubVersion
public void setStubVersion(String stubVersion)
Specify the JDK version for the generated stub code.
Specify "1.1" to pass the "-v1.1" option to rmic.
setVerify
public void setVerify(boolean 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; his defaults to false if not set.