|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.aspectj.tools.ant.taskdefs.AjcTask
public class AjcTask
This runs the AspectJ 1.1 compiler, supporting all the command-line options. In 1.1.1, ajc copies resources from input jars, but you can copy resources from the source directories using sourceRootCopyFilter. When not forking, things will be copied as needed for each iterative compile, but when forking things are only copied at the completion of a successful compile.
See the development environment guide for usage documentation.
| Nested Class Summary | |
|---|---|
static class |
AjcTask.GuardedCommand
Commandline wrapper that only permits addition of non-empty values and converts to argfile form if necessary. |
| Field Summary | |
|---|---|
static java.lang.String |
COMMAND_EDITOR_NAME
|
| Constructor Summary | |
|---|---|
AjcTask()
|
|
| Method Summary | |
|---|---|
org.apache.tools.ant.types.Path |
createArgfiles()
|
org.apache.tools.ant.types.Path |
createAspectpath()
|
org.apache.tools.ant.types.Path |
createBootclasspath()
|
org.apache.tools.ant.types.Path |
createClasspath()
|
org.apache.tools.ant.types.Path |
createExtdirs()
|
org.apache.tools.ant.types.Path |
createForkclasspath()
|
org.apache.tools.ant.types.Path |
createInjars()
|
org.apache.tools.ant.types.Path |
createInpath()
|
org.apache.tools.ant.types.Path |
createInxml()
|
org.apache.tools.ant.types.Commandline.Argument |
createJvmarg()
support for nested <jvmarg> elements |
org.apache.tools.ant.types.Path |
createSourceRoots()
|
org.apache.tools.ant.types.Path |
createSrc()
|
org.apache.tools.ant.types.Path |
createSrcdir()
|
void |
execute()
Compile using ajc per settings. |
static java.io.File |
findAspectjtoolsJar()
Find aspectjtools.jar on the task or system classpath. |
boolean |
isForked()
|
boolean |
isInIncrementalFileMode()
|
boolean |
isInIncrementalMode()
|
boolean |
quit()
Halt processing. |
void |
readArguments(java.lang.String[] args)
Read arguments in as if from a command line, mainly to support compiler adapter compilerarg subelement. |
void |
reset()
to use this same Task more than once (testing) |
void |
setArgfiles(org.apache.tools.ant.types.Path path)
|
void |
setArgfilesref(org.apache.tools.ant.types.Reference ref)
|
void |
setAspectpath(org.apache.tools.ant.types.Path path)
|
void |
setAspectpathref(org.apache.tools.ant.types.Reference ref)
|
void |
setBootclasspath(org.apache.tools.ant.types.Path path)
|
void |
setBootclasspathref(org.apache.tools.ant.types.Reference bootclasspathref)
|
void |
setCheckRuntimeVersion(boolean b)
|
void |
setClasspath(org.apache.tools.ant.types.Path path)
|
void |
setClasspathref(org.apache.tools.ant.types.Reference classpathref)
|
void |
setCommandEditor(ICommandEditor editor)
direct API for testing |
void |
setCommandEditorClass(java.lang.String className)
Setup command-line filter. |
void |
setCompliance(java.lang.String input)
Language compliance level. |
void |
setCopyInjars(boolean doCopy)
Flag to copy all non-.class contents of injars to outjar after compile completes. |
void |
setCrossrefs(boolean on)
|
void |
setDebug(boolean debug)
|
void |
setDebugLevel(java.lang.String level)
|
void |
setDeprecation(boolean deprecation)
|
void |
setDestdir(java.io.File dir)
|
void |
setEmacssym(boolean emacssym)
|
void |
setEncoding(java.lang.String encoding)
|
void |
setExtdirs(org.apache.tools.ant.types.Path path)
|
void |
setExtdirsref(org.apache.tools.ant.types.Reference ref)
|
void |
setFailonerror(boolean failonerror)
|
void |
setFork(boolean fork)
|
void |
setForkclasspath(org.apache.tools.ant.types.Path path)
|
void |
setForkclasspathref(org.apache.tools.ant.types.Reference forkclasspathref)
|
void |
setHelp(boolean help)
|
void |
setIncremental(boolean incremental)
|
void |
setInjars(org.apache.tools.ant.types.Path path)
|
void |
setInjarsref(org.apache.tools.ant.types.Reference ref)
|
void |
setInpath(org.apache.tools.ant.types.Path path)
|
void |
setInpathDirCopyFilter(java.lang.String filter)
Option to copy all files from all inpath directories except the files specified here. |
void |
setInpathref(org.apache.tools.ant.types.Reference ref)
|
void |
setInxml(org.apache.tools.ant.types.Path path)
|
void |
setInxmlref(org.apache.tools.ant.types.Reference ref)
|
void |
setListFileArgs(boolean listFileArgs)
|
void |
setLog(java.io.File file)
|
void |
setLogCommand(boolean logCommand)
|
void |
setMaxmem(java.lang.String maxMem)
|
void |
setMessageHolder(IMessageHolder holder)
direct API for testing |
void |
setMessageHolderClass(java.lang.String className)
Setup custom message handling. |
void |
setNoExit(boolean noExit)
|
void |
setNoImportError(boolean noImportError)
|
void |
setNowarn(boolean nowarn)
|
void |
setNoWeave(boolean b)
|
void |
setOutjar(java.io.File file)
|
void |
setOutxml(boolean outxml)
|
void |
setOutxmlfile(java.lang.String name)
|
void |
setPreserveAllLocals(boolean preserveAllLocals)
|
void |
setProceedOnError(boolean proceedOnError)
|
void |
setReferenceInfo(boolean referenceInfo)
|
void |
setShowWeaveInfo(boolean showweaveinfo)
|
void |
setSource(java.lang.String input)
Source compliance level. |
void |
setSourceRootCopyFilter(java.lang.String filter)
Option to copy all files from all source root directories except those specified here. |
void |
setSourceRoots(org.apache.tools.ant.types.Path roots)
|
void |
setSourcerootsref(org.apache.tools.ant.types.Reference ref)
|
void |
setSrcDir(org.apache.tools.ant.types.Path path)
|
void |
setTagFile(java.io.File file)
|
void |
setTarget(java.lang.String input)
|
void |
setTime(boolean time)
|
void |
setTimers(boolean timers)
|
java.lang.String |
setupAjc(org.apache.tools.ant.taskdefs.Javac javac)
This method extracts javac arguments to ajc, and add arguments to make ajc behave more like javac in copying resources. |
void |
setVerbose(boolean verbose)
|
void |
setVersion(boolean version)
|
void |
setWarn(java.lang.String warnings)
|
void |
setX(java.lang.String input)
|
void |
setXaddSerialVersionUID(boolean addUID)
|
void |
setXDoneSignal(java.lang.String doneSignal)
|
void |
setXJoinpoints(java.lang.String optionalJoinpoints)
|
void |
setXlint(java.lang.String xlint)
-Xlint:{error|warning|info} - set default level for -Xlint messages |
void |
setXlintfile(java.io.File xlintFile)
-Xlintfile {lint.properties} - enable or disable specific forms of -Xlint messages based on a lint properties file (default is org/aspectj/weaver/XLintDefault.properties) |
void |
setXlintwarnings(boolean xlintwarnings)
-Xlint - set default level of -Xlint messages to warning (same as -Xlint:warning) |
void |
setXmlConfigured(boolean xmlConfigured)
|
void |
setXNoInline(boolean noInline)
|
void |
setXNotReweavable(boolean notReweavable)
|
void |
setXNoWeave(boolean b)
|
void |
setXReweavable(boolean reweavable)
|
void |
setXTerminateAfterCompilation(boolean b)
|
void |
setXWeaveDir(java.io.File file)
|
| Methods inherited from class org.apache.tools.ant.taskdefs.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, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getProject |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COMMAND_EDITOR_NAME
| Constructor Detail |
|---|
public AjcTask()
| Method Detail |
|---|
public java.lang.String setupAjc(org.apache.tools.ant.taskdefs.Javac javac)
Pass ajc-specific options using compilerarg sub-element:
<javac srcdir="src">
<compilerarg compiler="..." line="-argfile src/args.lst"/>
<javac>
Some javac arguments are not supported in this component (yet):
String memoryInitialSize; boolean includeAntRuntime = true; boolean includeJavaRuntime = false;Other javac arguments are not supported in ajc 1.1:
boolean optimize; String forkedExecutable; FacadeTaskHelper facade; boolean depend; String debugLevel; Path compileSourcepath;
javac - the Javac command to implement (not null)ajc - the AjcTask to adapt (not null)destDir - the File class destination directory (may be null)
public static java.io.File findAspectjtoolsJar()
aspectj{-}tools{...}.jar mainly to support build
systems using maven-style re-naming (e.g., aspectj-tools-1.1.0.jar. Note that we search the task classpath
first, though an entry on the system classpath would be loaded first, because it seems more correct as the more specific one.
public void reset()
public void setIncremental(boolean incremental)
public void setLogCommand(boolean logCommand)
public void setHelp(boolean help)
public void setVersion(boolean version)
public void setXTerminateAfterCompilation(boolean b)
public void setXReweavable(boolean reweavable)
public void setXmlConfigured(boolean xmlConfigured)
public void setXJoinpoints(java.lang.String optionalJoinpoints)
public void setCheckRuntimeVersion(boolean b)
public void setXNoWeave(boolean b)
public void setNoWeave(boolean b)
public void setXNotReweavable(boolean notReweavable)
public void setXaddSerialVersionUID(boolean addUID)
public void setXNoInline(boolean noInline)
public void setShowWeaveInfo(boolean showweaveinfo)
public void setNowarn(boolean nowarn)
public void setDeprecation(boolean deprecation)
public void setWarn(java.lang.String warnings)
public void setDebug(boolean debug)
public void setDebugLevel(java.lang.String level)
public void setEmacssym(boolean emacssym)
public void setCrossrefs(boolean on)
public void setXlintwarnings(boolean xlintwarnings)
public void setXlint(java.lang.String xlint)
xlint - the String with one of error, warning, ignoredpublic void setXlintfile(java.io.File xlintFile)
org/aspectj/weaver/XLintDefault.properties)
xlintFile - the File with lint propertiespublic void setPreserveAllLocals(boolean preserveAllLocals)
public void setNoImportError(boolean noImportError)
public void setEncoding(java.lang.String encoding)
public void setLog(java.io.File file)
public void setProceedOnError(boolean proceedOnError)
public void setVerbose(boolean verbose)
public void setTimers(boolean timers)
public void setListFileArgs(boolean listFileArgs)
public void setReferenceInfo(boolean referenceInfo)
public void setTime(boolean time)
public void setNoExit(boolean noExit)
public void setFailonerror(boolean failonerror)
public boolean isForked()
public void setFork(boolean fork)
public void setMaxmem(java.lang.String maxMem)
public org.apache.tools.ant.types.Commandline.Argument createJvmarg()
public void setTagFile(java.io.File file)
public void setOutjar(java.io.File file)
public void setOutxml(boolean outxml)
public void setOutxmlfile(java.lang.String name)
public void setDestdir(java.io.File dir)
public void setTarget(java.lang.String input)
input - a String in TARGET_INPUTSpublic void setCompliance(java.lang.String input)
input - a String in COMPLIANCE_INPUTSpublic void setSource(java.lang.String input)
input - a String in SOURCE_INPUTSpublic void setCopyInjars(boolean doCopy)
doCopy - public void setSourceRootCopyFilter(java.lang.String filter)
filter - a String acceptable as an excludes filter for an Ant Zip fileset.public void setInpathDirCopyFilter(java.lang.String filter)
filter - a String acceptable as an excludes filter for an Ant Zip fileset.public void setX(java.lang.String input)
public void setXDoneSignal(java.lang.String doneSignal)
public void setMessageHolder(IMessageHolder holder)
public void setMessageHolderClass(java.lang.String className)
className - the String fully-qualified-name of a class reachable from this object's class loader, implementing
IMessageHolder, and having a public no-argument constructor.
org.apache.tools.ant.BuildException - if unable to create instance of classNamepublic void setCommandEditor(ICommandEditor editor)
public void setCommandEditorClass(java.lang.String className)
org.aspectj.tools.ant.taskdefs.AjcTask.COMMAND_EDITOR with the className parameter.
className - the String fully-qualified-name of a class reachable from this object's class loader, implementing
ICommandEditor, and having a public no-argument constructor.
org.apache.tools.ant.BuildException - if unable to create instance of classNamepublic void setSourcerootsref(org.apache.tools.ant.types.Reference ref)
public void setSourceRoots(org.apache.tools.ant.types.Path roots)
public org.apache.tools.ant.types.Path createSourceRoots()
public void setXWeaveDir(java.io.File file)
public void setInjarsref(org.apache.tools.ant.types.Reference ref)
public void setInpathref(org.apache.tools.ant.types.Reference ref)
public void setInjars(org.apache.tools.ant.types.Path path)
public void setInpath(org.apache.tools.ant.types.Path path)
public org.apache.tools.ant.types.Path createInjars()
public org.apache.tools.ant.types.Path createInpath()
public void setClasspath(org.apache.tools.ant.types.Path path)
public void setClasspathref(org.apache.tools.ant.types.Reference classpathref)
public org.apache.tools.ant.types.Path createClasspath()
public void setBootclasspath(org.apache.tools.ant.types.Path path)
public void setBootclasspathref(org.apache.tools.ant.types.Reference bootclasspathref)
public org.apache.tools.ant.types.Path createBootclasspath()
public void setForkclasspath(org.apache.tools.ant.types.Path path)
public void setForkclasspathref(org.apache.tools.ant.types.Reference forkclasspathref)
public org.apache.tools.ant.types.Path createForkclasspath()
public void setExtdirs(org.apache.tools.ant.types.Path path)
public void setExtdirsref(org.apache.tools.ant.types.Reference ref)
public org.apache.tools.ant.types.Path createExtdirs()
public void setAspectpathref(org.apache.tools.ant.types.Reference ref)
public void setAspectpath(org.apache.tools.ant.types.Path path)
public org.apache.tools.ant.types.Path createAspectpath()
public void setSrcDir(org.apache.tools.ant.types.Path path)
public org.apache.tools.ant.types.Path createSrc()
public org.apache.tools.ant.types.Path createSrcdir()
public boolean isInIncrementalMode()
public boolean isInIncrementalFileMode()
public void setArgfilesref(org.apache.tools.ant.types.Reference ref)
public void setArgfiles(org.apache.tools.ant.types.Path path)
public org.apache.tools.ant.types.Path createArgfiles()
public void setInxmlref(org.apache.tools.ant.types.Reference ref)
public void setInxml(org.apache.tools.ant.types.Path path)
public org.apache.tools.ant.types.Path createInxml()
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - if the compilation has problems or if there were compiler errors and failonerror is true.public boolean quit()
public void readArguments(java.lang.String[] args)
args - the String[] of arguments to read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||