org.apache.tools.ant.taskdefs.optional

Class NetRexxC

public class NetRexxC extends MatchingTask

Compiles NetRexx source files. This task can take the following arguments: Of these arguments, the srcdir argument is required.

When this task executes, it will recursively scan the srcdir looking for NetRexx source files to compile. This task makes its compile decision based on timestamp.

Before files are compiled they and any other file in the srcdir will be copied to the destdir allowing support files to be located properly in the classpath. The reason for copying the source files before the compile is that NetRexxC has only two destinations for classfiles:

  1. The current directory, and,
  2. The directory the source is in (see sourcedir option)
Nested Class Summary
static classNetRexxC.TraceAttr
Enumerated class corresponding to the trace attribute.
static classNetRexxC.VerboseAttr
Enumerated class corresponding to the verbose attribute.
Method Summary
voidexecute()
Executes the task - performs the actual compiler call.
voidinit()
init-Method sets defaults from Properties.
voidsetBinary(boolean binary)
Set whether literals are treated as binary, rather than NetRexx types.
voidsetClasspath(String classpath)
Set the classpath used for NetRexx compilation.
voidsetComments(boolean comments)
Set whether comments are passed through to the generated java source.
voidsetCompact(boolean compact)
Set whether error messages come out in compact or verbose format.
voidsetCompile(boolean compile)
Set whether the NetRexx compiler should compile the generated java code Valid true values are "on" or "true".
voidsetConsole(boolean console)
Set whether or not messages should be displayed on the 'console' Valid true values are "on" or "true".
voidsetCrossref(boolean crossref)
Whether variable cross references are generated.
voidsetDecimal(boolean decimal)
Set whether decimal arithmetic should be used for the netrexx code.
voidsetDestDir(File destDirName)
Set the destination directory into which the NetRexx source files should be copied and then compiled.
voidsetDiag(boolean diag)
Whether diagnostic information about the compile is generated
voidsetExplicit(boolean explicit)
Sets whether variables must be declared explicitly before use.
voidsetFormat(boolean format)
Whether the generated java code is formatted nicely or left to match NetRexx line numbers for call stack debugging.
voidsetJava(boolean java)
Whether the generated java code is produced Valid true values are "on" or "true".
voidsetKeep(boolean keep)
Sets whether the generated java source file should be kept after compilation.
voidsetLogo(boolean logo)
Whether the compiler text logo is displayed when compiling.
voidsetReplace(boolean replace)
Whether the generated .java file should be replaced when compiling Valid true values are "on" or "true".
voidsetSavelog(boolean savelog)
Sets whether the compiler messages will be written to NetRexxC.log as well as to the console Valid true values are "on" or "true".
voidsetSourcedir(boolean sourcedir)
Tells the NetRexx compiler to store the class files in the same directory as the source files.
voidsetSrcDir(File srcDirName)
Set the source dir to find the source Java files.
voidsetStrictargs(boolean strictargs)
Tells the NetRexx compiler that method calls always need parentheses, even if no arguments are needed, e.g.
voidsetStrictassign(boolean strictassign)
Tells the NetRexx compile that assignments must match exactly on type.
voidsetStrictcase(boolean strictcase)
Specifies whether the NetRexx compiler should be case sensitive or not.
voidsetStrictimport(boolean strictimport)
Sets whether classes need to be imported explicitly using an import statement.
voidsetStrictprops(boolean strictprops)
Sets whether local properties need to be qualified explicitly using this Valid true values are "on" or "true".
voidsetStrictsignal(boolean strictsignal)
Whether the compiler should force catching of exceptions by explicitly named types.
voidsetSuppressDeprecation(boolean suppressDeprecation)
Tells whether we should filter out any deprecation-messages of the compiler out.
voidsetSuppressExceptionNotSignalled(boolean suppressExceptionNotSignalled)
Whether the task should suppress the "FooException is in SIGNALS list but is not signalled within the method", which is sometimes rather useless.
voidsetSuppressMethodArgumentNotUsed(boolean suppressMethodArgumentNotUsed)
Whether the task should suppress the "Method argument is not used" in strictargs-Mode, which can not be suppressed by the compiler itself.
voidsetSuppressPrivatePropertyNotUsed(boolean suppressPrivatePropertyNotUsed)
Whether the task should suppress the "Private property is defined but not used" in strictargs-Mode, which can be quite annoying while developing.
voidsetSuppressVariableNotUsed(boolean suppressVariableNotUsed)
Whether the task should suppress the "Variable is set but not used" in strictargs-Mode.
voidsetSymbols(boolean symbols)
Sets whether debug symbols should be generated into the class file Valid true values are "on" or "true".
voidsetTime(boolean time)
Asks the NetRexx compiler to print compilation times to the console Valid true values are "on" or "true".
voidsetTrace(NetRexxC.TraceAttr trace)
Turns on or off tracing and directs the resultant trace output Valid values are: "trace", "trace1", "trace2" and "notrace".
voidsetTrace(String trace)
Turns on or off tracing and directs the resultant trace output Valid values are: "trace", "trace1", "trace2" and "notrace".
voidsetUtf8(boolean utf8)
Tells the NetRexx compiler that the source is in UTF8 Valid true values are "on" or "true".
voidsetVerbose(NetRexxC.VerboseAttr verbose)
Whether lots of warnings and error messages should be generated
voidsetVerbose(String verbose)
Whether lots of warnings and error messages should be generated

Method Detail

execute

public void execute()
Executes the task - performs the actual compiler call.

Throws: BuildException on error.

init

public void init()
init-Method sets defaults from Properties. That way, when ant is called with arguments like -Dant.netrexxc.verbose=verbose5 one can easily take control of all netrexxc-tasks.

setBinary

public void setBinary(boolean binary)
Set whether literals are treated as binary, rather than NetRexx types.

Parameters: binary a boolean value.

setClasspath

public void setClasspath(String classpath)
Set the classpath used for NetRexx compilation.

Parameters: classpath the classpath to use.

setComments

public void setComments(boolean comments)
Set whether comments are passed through to the generated java source. Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false

Parameters: comments a boolean value.

setCompact

public void setCompact(boolean compact)
Set whether error messages come out in compact or verbose format. Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false

Parameters: compact a boolean value.

setCompile

public void setCompile(boolean compile)
Set whether the NetRexx compiler should compile the generated java code Valid true values are "on" or "true". Anything else sets the flag to false. The default value is true. Setting this flag to false, will automatically set the keep flag to true.

Parameters: compile a boolean value.

setConsole

public void setConsole(boolean console)
Set whether or not messages should be displayed on the 'console' Valid true values are "on" or "true". Anything else sets the flag to false. The default value is true.

Parameters: console a boolean value.

setCrossref

public void setCrossref(boolean crossref)
Whether variable cross references are generated.

Parameters: crossref a boolean value.

setDecimal

public void setDecimal(boolean decimal)
Set whether decimal arithmetic should be used for the netrexx code. Binary arithmetic is used when this flag is turned off. Valid true values are "on" or "true". Anything else sets the flag to false. The default value is true.

Parameters: decimal a boolean value.

setDestDir

public void setDestDir(File destDirName)
Set the destination directory into which the NetRexx source files should be copied and then compiled.

Parameters: destDirName the destination directory.

setDiag

public void setDiag(boolean diag)
Whether diagnostic information about the compile is generated

Parameters: diag a boolean value.

setExplicit

public void setExplicit(boolean explicit)
Sets whether variables must be declared explicitly before use. Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: explicit a boolean value.

setFormat

public void setFormat(boolean format)
Whether the generated java code is formatted nicely or left to match NetRexx line numbers for call stack debugging.

Parameters: format a boolean value.

setJava

public void setJava(boolean java)
Whether the generated java code is produced Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: java a boolean value.

setKeep

public void setKeep(boolean keep)
Sets whether the generated java source file should be kept after compilation. The generated files will have an extension of .java.keep, not .java Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: keep a boolean value.

setLogo

public void setLogo(boolean logo)
Whether the compiler text logo is displayed when compiling.

Parameters: logo a boolean value.

setReplace

public void setReplace(boolean replace)
Whether the generated .java file should be replaced when compiling Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: replace a boolean value.

setSavelog

public void setSavelog(boolean savelog)
Sets whether the compiler messages will be written to NetRexxC.log as well as to the console Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: savelog a boolean value.

setSourcedir

public void setSourcedir(boolean sourcedir)
Tells the NetRexx compiler to store the class files in the same directory as the source files. The alternative is the working directory Valid true values are "on" or "true". Anything else sets the flag to false. The default value is true.

Parameters: sourcedir a boolean value.

setSrcDir

public void setSrcDir(File srcDirName)
Set the source dir to find the source Java files.

Parameters: srcDirName the source directory.

setStrictargs

public void setStrictargs(boolean strictargs)
Tells the NetRexx compiler that method calls always need parentheses, even if no arguments are needed, e.g. aStringVar.getBytes vs. aStringVar.getBytes() Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: strictargs a boolean value.

setStrictassign

public void setStrictassign(boolean strictassign)
Tells the NetRexx compile that assignments must match exactly on type.

Parameters: strictassign a boolean value.

setStrictcase

public void setStrictcase(boolean strictcase)
Specifies whether the NetRexx compiler should be case sensitive or not.

Parameters: strictcase a boolean value.

setStrictimport

public void setStrictimport(boolean strictimport)
Sets whether classes need to be imported explicitly using an import statement. By default the NetRexx compiler will import certain packages automatically Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: strictimport a boolean value.

setStrictprops

public void setStrictprops(boolean strictprops)
Sets whether local properties need to be qualified explicitly using this Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: strictprops a boolean value.

setStrictsignal

public void setStrictsignal(boolean strictsignal)
Whether the compiler should force catching of exceptions by explicitly named types.

Parameters: strictsignal a boolean value.

setSuppressDeprecation

public void setSuppressDeprecation(boolean suppressDeprecation)
Tells whether we should filter out any deprecation-messages of the compiler out.

Parameters: suppressDeprecation a boolean value.

setSuppressExceptionNotSignalled

public void setSuppressExceptionNotSignalled(boolean suppressExceptionNotSignalled)
Whether the task should suppress the "FooException is in SIGNALS list but is not signalled within the method", which is sometimes rather useless. The warning is logged as verbose message, though.

Parameters: suppressExceptionNotSignalled a boolean value.

setSuppressMethodArgumentNotUsed

public void setSuppressMethodArgumentNotUsed(boolean suppressMethodArgumentNotUsed)
Whether the task should suppress the "Method argument is not used" in strictargs-Mode, which can not be suppressed by the compiler itself. The warning is logged as verbose message, though.

Parameters: suppressMethodArgumentNotUsed a boolean value.

setSuppressPrivatePropertyNotUsed

public void setSuppressPrivatePropertyNotUsed(boolean suppressPrivatePropertyNotUsed)
Whether the task should suppress the "Private property is defined but not used" in strictargs-Mode, which can be quite annoying while developing. The warning is logged as verbose message, though.

Parameters: suppressPrivatePropertyNotUsed a boolean value.

setSuppressVariableNotUsed

public void setSuppressVariableNotUsed(boolean suppressVariableNotUsed)
Whether the task should suppress the "Variable is set but not used" in strictargs-Mode. Be careful with this one! The warning is logged as verbose message, though.

Parameters: suppressVariableNotUsed a boolean value.

setSymbols

public void setSymbols(boolean symbols)
Sets whether debug symbols should be generated into the class file Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: symbols a boolean value.

setTime

public void setTime(boolean time)
Asks the NetRexx compiler to print compilation times to the console Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: time a boolean value.

setTrace

public void setTrace(NetRexxC.TraceAttr trace)
Turns on or off tracing and directs the resultant trace output Valid values are: "trace", "trace1", "trace2" and "notrace". "trace" and "trace2".

Parameters: trace the value to set.

setTrace

public void setTrace(String trace)
Turns on or off tracing and directs the resultant trace output Valid values are: "trace", "trace1", "trace2" and "notrace". "trace" and "trace2".

Parameters: trace the value to set.

setUtf8

public void setUtf8(boolean utf8)
Tells the NetRexx compiler that the source is in UTF8 Valid true values are "on" or "true". Anything else sets the flag to false. The default value is false.

Parameters: utf8 a boolean value.

setVerbose

public void setVerbose(NetRexxC.VerboseAttr verbose)
Whether lots of warnings and error messages should be generated

Parameters: verbose the value to set - verbose<level> or noverbose.

setVerbose

public void setVerbose(String verbose)
Whether lots of warnings and error messages should be generated

Parameters: verbose the value to set - verbose<level> or noverbose.