Class NetRexxC
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.tools.ant.taskdefs.optional.NetRexxC
- All Implemented Interfaces:
Cloneable, SelectorContainer
Compiles NetRexx source files.
This task can take the following
arguments:
- binary
- classpath
- comments
- compile
- console
- crossref
- decimal
- destdir
- diag
- explicit
- format
- keep
- logo
- replace
- savelog
- srcdir
- sourcedir
- strictargs
- strictassign
- strictcase
- strictimport
- symbols
- time
- trace
- utf8
- verbose
- suppressMethodArgumentNotUsed
- suppressPrivatePropertyNotUsed
- suppressVariableNotUsed
- suppressExceptionNotSignalled
- suppressDeprecation
- removeKeepExtension
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:
- The current directory, and,
- The directory the source is in (see sourcedir option)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnumerated class corresponding to the trace attribute.static classEnumerated class corresponding to the verbose attribute. -
Field Summary
Fields inherited from class MatchingTask
filesetFields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()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.voidsetConsole(boolean console) Set whether or not compiler messages should be displayed on the 'console'.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 generatedvoidsetExplicit(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.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.voidsetRemoveKeepExtension(boolean removeKeepExtension) Tells whether the trailing .keep in nocompile-mode should be removed so that the resulting java source really ends on .java.voidsetReplace(boolean replace) Whether the generated .java file should be replaced when compiling.voidsetSavelog(boolean savelog) Sets whether the compiler messages will be written to NetRexxC.log as well as to the console.voidsetSourcedir(boolean sourcedir) Tells the NetRexx compiler to store the class files in the same directory as the source files.voidSet 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 animportstatement.voidsetStrictprops(boolean strictprops) Sets whether local properties need to be qualified explicitly usingthis.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.voidsetTime(boolean time) Asks the NetRexx compiler to print compilation times to the console Valid true values are "yes", "on" or "true".voidTurns on or off tracing and directs the resultant trace output Valid values are: "trace", "trace1", "trace2" and "notrace".voidsetTrace(NetRexxC.TraceAttr 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.voidsetVerbose(String verbose) Whether lots of warnings and error messages should be generatedvoidsetVerbose(NetRexxC.VerboseAttr verbose) Whether lots of warnings and error messages should be generatedMethods inherited from class MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItemsModifier and TypeMethodDescriptionvoidadd(FileSelector selector) add an arbitrary selectorvoidaddAnd(AndSelector selector) add an "And" selector entry on the selector listvoidaddContains(ContainsSelector selector) add a contains selector entry on the selector listvoidaddContainsRegexp(ContainsRegexpSelector selector) add a regular expression selector entry on the selector listvoidaddCustom(ExtendSelector selector) add an extended selector entry on the selector listvoidaddDate(DateSelector selector) add a selector date entry on the selector listvoidaddDepend(DependSelector selector) add a depends selector entry on the selector listvoidaddDepth(DepthSelector selector) add a depth selector entry on the selector listvoidaddDifferent(DifferentSelector selector) add a type selector entry on the type listvoidaddFilename(FilenameSelector selector) add a selector filename entry on the selector listvoidaddMajority(MajoritySelector selector) add a majority selector entry on the selector listvoidaddModified(ModifiedSelector selector) add the modified selectorvoidaddNone(NoneSelector selector) add a "None" selector entry on the selector listvoidaddNot(NotSelector selector) add a "Not" selector entry on the selector listvoidaddOr(OrSelector selector) add an "Or" selector entry on the selector listvoidaddPresent(PresentSelector selector) add a present selector entry on the selector listvoidaddSelector(SelectSelector selector) add a "Select" selector entry on the selector listvoidaddSize(SizeSelector selector) add a selector size entry on the selector listvoidaddType(TypeSelector selector) add a type selector entry on the type listvoidappendSelector(FileSelector selector) Add a new selector into this container.add a name entry on the exclude listadd a name entry on the include files listadd a name entry on the include listadd a name entry on the include files listadd a set of patternsprotected DirectoryScannergetDirectoryScanner(File baseDir) Returns the directory scanner needed to access the files to process.protected final FileSetAccessor for the implicit fileset.Returns the set of selectors as an array.booleanIndicates whether there are any selectors here.intGives the count of the number of selectors in this containerReturns an enumerator for accessing the set of selectors.voidsetCaseSensitive(boolean isCaseSensitive) Sets case sensitivity of the file systemvoidsetDefaultexcludes(boolean useDefaultExcludes) Sets whether default exclusions should be used or not.voidsetExcludes(String excludes) Sets the set of exclude patterns.voidsetExcludesfile(File excludesfile) Sets the name of the file containing the includes patterns.voidsetFollowSymlinks(boolean followSymlinks) Sets whether or not symbolic links or Windows junctions should be followed.voidsetIncludes(String includes) Sets the set of include patterns.voidsetIncludesfile(File includesfile) Sets the name of the file containing the includes patterns.voidsetProject(Project project) Sets the project object of this component.voidXsetIgnore(String ignoreString) List of filenames and directory names to not include.voidSet this to be the items in the base directory that you want to be included.Methods inherited from class Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocationModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.
-
Constructor Details
-
NetRexxC
public NetRexxC()
-
-
Method Details
-
setBinary
public void setBinary(boolean binary) Set whether literals are treated as binary, rather than NetRexx types. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default is false.- Parameters:
binary- abooleanvalue.
-
setClasspath
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 "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
comments- abooleanvalue.
-
setCompact
public void setCompact(boolean compact) Set whether error messages come out in compact or verbose format. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is true.- Parameters:
compact- abooleanvalue.
-
setCompile
public void setCompile(boolean compile) Set whether the NetRexx compiler should compile the generated java code. Valid true values are "yes", "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- abooleanvalue.
-
setConsole
public void setConsole(boolean console) Set whether or not compiler messages should be displayed on the 'console'. Note that this task will rely on the default value for filtering compile messages. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
console- abooleanvalue.
-
setCrossref
public void setCrossref(boolean crossref) Whether variable cross references are generated. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
crossref- abooleanvalue.
-
setDecimal
public void setDecimal(boolean decimal) Set whether decimal arithmetic should be used for the netrexx code. Setting this to off will report decimal arithmetic as an error, for performance critical applications. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is true.- Parameters:
decimal- abooleanvalue.
-
setDestDir
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- abooleanvalue.
-
setExplicit
public void setExplicit(boolean explicit) Sets whether variables must be declared explicitly before use. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
explicit- abooleanvalue.
-
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. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value false.- Parameters:
format- abooleanvalue.
-
setJava
public void setJava(boolean java) Whether the generated java code is produced. This is not implemented yet.- Parameters:
java- abooleanvalue.
-
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. See setRemoveKeepExtension Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
keep- abooleanvalue.- See Also:
-
setLogo
public void setLogo(boolean logo) Whether the compiler text logo is displayed when compiling. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
logo- abooleanvalue.
-
setReplace
public void setReplace(boolean replace) Whether the generated .java file should be replaced when compiling. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
replace- abooleanvalue.
-
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 "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
savelog- abooleanvalue.
-
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 "yes", "on" or "true". Anything else sets the flag to false. The default value is true.- Parameters:
sourcedir- abooleanvalue.
-
setSrcDir
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.getBytesvs.aStringVar.getBytes(). Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
strictargs- abooleanvalue.
-
setStrictassign
public void setStrictassign(boolean strictassign) Tells the NetRexx compile that assignments must match exactly on type. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
strictassign- abooleanvalue.
-
setStrictcase
public void setStrictcase(boolean strictcase) Specifies whether the NetRexx compiler should be case sensitive or not. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
strictcase- abooleanvalue.
-
setStrictimport
public void setStrictimport(boolean strictimport) Sets whether classes need to be imported explicitly using animportstatement. By default the NetRexx compiler will import certain packages automatically. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
strictimport- abooleanvalue.
-
setStrictprops
public void setStrictprops(boolean strictprops) Sets whether local properties need to be qualified explicitly usingthis. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
strictprops- abooleanvalue.
-
setStrictsignal
public void setStrictsignal(boolean strictsignal) Whether the compiler should force catching of exceptions by explicitly named types. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false- Parameters:
strictsignal- abooleanvalue.
-
setSymbols
public void setSymbols(boolean symbols) Sets whether debug symbols should be generated into the class file. Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
symbols- abooleanvalue.
-
setTime
public void setTime(boolean time) Asks the NetRexx compiler to print compilation times to the console Valid true values are "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
time- abooleanvalue.
-
setTrace
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
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 "yes", "on" or "true". Anything else sets the flag to false. The default value is false.- Parameters:
utf8- abooleanvalue.
-
setVerbose
Whether lots of warnings and error messages should be generated- Parameters:
verbose- the value to set - verbose<level> or noverbose.
-
setVerbose
Whether lots of warnings and error messages should be generated- Parameters:
verbose- the value to set - verbose<level> or noverbose.
-
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- abooleanvalue.
-
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- abooleanvalue.
-
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- abooleanvalue.
-
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- abooleanvalue.
-
setSuppressDeprecation
public void setSuppressDeprecation(boolean suppressDeprecation) Tells whether we should filter out any deprecation-messages of the compiler out.- Parameters:
suppressDeprecation- abooleanvalue.
-
setRemoveKeepExtension
public void setRemoveKeepExtension(boolean removeKeepExtension) Tells whether the trailing .keep in nocompile-mode should be removed so that the resulting java source really ends on .java. This facilitates the use of the javadoc tool later on.- Parameters:
removeKeepExtension- boolean
-
init
-
execute
Executes the task - performs the actual compiler call.- Overrides:
executein classTask- Throws:
BuildException- on error.
-