Class AspectJCompiler
- All Implemented Interfaces:
Compiler
Options
-injars JarList
Accept as source bytecode any .class files inside the specified .jar files. The output will include these classes, possibly as woven with any applicable aspects. JarList, like classpath, is a single argument containing a list of paths to jar files, delimited by the platform- specific classpath delimiter.
-aspectpath JarList
Weave binary aspects from JarList zip files into all sources. The aspects should have been output by the same version of the compiler. To run the output classes requires putting all the aspectpath entries on the run classpath. JarList, like classpath, is a single argument containing a list of paths to jar files, delimited by the platform- specific classpath delimiter.
-argfile File
The file is a line-delimited list of arguments. These arguments are inserted into the argument list.
-outjar output.jar
Put output classes in zip file output.jar.
-incremental
Run the compiler continuously. After the initial compilation, the compiler will wait to recompile until it reads a newline from the standard input, and will quit when it reads a 'q'. It will only recompile necessary components, so a recompile should be much faster than doing a second compile. This requires -sourceroots.
-sourceroots DirPaths
Find and build all .java or .aj source files under any directory listed in DirPaths. DirPaths, like classpath, is a single argument containing a list of paths to directories, delimited by the platform- specific classpath delimiter. Required by -incremental.
-emacssym
Generate .ajesym symbol files for emacs support
-Xlint
Same as -Xlint:warning (enabled by default)
-Xlint:{level}
Set default level for messages about potential programming mistakes in crosscutting code. {level} may be ignore, warning, or error. This overrides entries in org/aspectj/weaver/XlintDefault.properties from aspectjtools.jar, but does not override levels set using the -Xlintfile option.
-Xlintfile PropertyFile
Specify properties file to set levels for specific crosscutting messages. PropertyFile is a path to a Java .properties file that takes the same property names and values as org/aspectj/weaver/XlintDefault.properties from aspectjtools.jar, which it also overrides. -help
Emit information on compiler options and usage
-version
Emit the version of the AspectJ compiler
-classpath Path
Specify where to find user class files. Path is a single argument containing a list of paths to zip files or directories, delimited by the platform-specific path delimiter.
-bootclasspath Path
Override location of VM's bootclasspath for purposes of evaluating types when compiling. Path is a single argument containing a list of paths to zip files or directories, delimited by the platform-specific path delimiter.
-extdirs Path
Override location of VM's extension directories for purposes of evaluating types when compiling. Path is a single argument containing a list of paths to directories, delimited by the platform-specific path delimiter.
-d Directory
Specify where to place generated .class files. If not specified, Directory defaults to the current working dir.
-target [1.1|1.2]
Specify classfile target setting (1.1 or 1.2, default is 1.1)
-1.3
Set compliance level to 1.3 (default) -1.4
Set compliance level to 1.4 -source [1.3|1.4]
Toggle assertions (1.3 or 1.4, default is 1.3 in -1.3 mode and 1.4 in -1.4 mode). When using -source 1.3, an assert() statement valid under Java 1.4 will result in a compiler error. When using -source 1.4, treat assert as a keyword and implement assertions according to the 1.4 language spec.
-nowarn
Emit no warnings (equivalent to '-warn:none') This does not suppress messages generated by declare warning or Xlint.
-warn: items
Emit warnings for any instances of the comma-delimited list of questionable code (eg '-warn:unusedLocals,deprecation'):
constructorName method with constructor name packageDefaultMethod attempt to override package-default method deprecation usage of deprecated type or member maskedCatchBlocks hidden catch block unusedLocals local variable never read unusedArguments method argument never read unusedImports import statement not used by code in file none suppress all compiler warnings
-warn:none does not suppress messages generated by declare warning or Xlint.
-deprecation
Same as -warn:deprecation
-noImportError
Emit no errors for unresolved imports
-proceedOnError
Keep compiling after error, dumping class files with problem methods
-g:[lines,vars,source]
debug attributes level, that may take three forms:
-g all debug info ('-g:lines,vars,source') -g:none no debug info -g:{items} debug info for any/all of [lines, vars, source], e.g., -g:lines,source
-preserveAllLocals
Preserve all local variables during code generation (to facilitate debugging).
-referenceInfo
Compute reference information.
-encoding format
Specify default source encoding format. Specify custom encoding on a per file basis by suffixing each input source file/folder name with '[encoding]'.
-verbose
Emit messages about accessed/processed compilation units
-log file Specify a log file for compiler messages.
-progress Show progress (requires -log mode).
-time Display speed information.
-noExit Do not call System.exit(n) at end of compilation (n=0 if no error)
-repeat N Repeat compilation process N times (typically to do performance analysis).
-Xnoweave (Experimental) produce unwoven class files for input using -injars.
-Xnoinline (Experimental) do not inline around advice
-XincrementalFile file
(Experimental) This works like incremental mode, but using a file rather than standard input to control the compiler. It will recompile each time file is changed and and halt when file is deleted.
-XserializableAspects (Experimental) Normally it is an error to declare aspects Serializable. This option removes that restriction.
- Author:
- Jason van Zyl
-
Field Summary
Fields inherited from class org.codehaus.plexus.compiler.AbstractCompiler
EOL, PS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
protected static String[]
getSourceFiles
(CompilerConfiguration config) getSourceFilesForSourceRoot
(CompilerConfiguration config, String sourceLocation) performCompile
(CompilerConfiguration config) Methods inherited from class org.codehaus.plexus.compiler.AbstractCompiler
canUpdateTarget, getCompilerOutputStyle, getInputFileEnding, getLog, getLogger, getOutputFile, getOutputFileEnding, getPathString, logCompiling, makeClassName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.plexus.compiler.Compiler
supportsIncrementalCompilation
-
Constructor Details
-
AspectJCompiler
public AspectJCompiler()
-
-
Method Details
-
getCompilerId
- Specified by:
getCompilerId
in classAbstractCompiler
-
performCompile
- Specified by:
performCompile
in interfaceCompiler
- Overrides:
performCompile
in classAbstractCompiler
- Throws:
CompilerException
-
createCommandLine
- Returns:
- null
- Throws:
CompilerException
-
getSourceFiles
-
getSourceFilesForSourceRoot
protected static Set<String> getSourceFilesForSourceRoot(CompilerConfiguration config, String sourceLocation)
-