public abstract class DefaultCompilerAdapter extends Object implements CompilerAdapter, CompilerAdapterExtension
Modifier and Type | Field and Description |
---|---|
protected Javac |
attributes |
protected Path |
bootclasspath |
protected Path |
compileClasspath |
protected File[] |
compileList |
protected Path |
compileSourcepath |
protected boolean |
debug |
protected boolean |
depend |
protected boolean |
deprecation |
protected File |
destDir |
protected String |
encoding |
protected Path |
extdirs |
protected boolean |
includeAntRuntime |
protected boolean |
includeJavaRuntime |
protected Location |
location |
protected static String |
lSep |
protected String |
memoryInitialSize |
protected String |
memoryMaximumSize |
protected Path |
modulepath |
protected Path |
moduleSourcepath |
protected boolean |
optimize |
protected Project |
project |
protected String |
release |
protected Path |
src |
protected String |
target |
protected Path |
upgrademodulepath |
protected boolean |
verbose |
Constructor and Description |
---|
DefaultCompilerAdapter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCurrentCompilerArgs(Commandline cmd)
Adds the command line arguments specific to the current implementation.
|
protected boolean |
assumeJava11()
Shall we assume JDK 1.1 command line switches?
|
protected boolean |
assumeJava12()
Shall we assume JDK 1.2 command line switches?
|
protected boolean |
assumeJava13()
Shall we assume JDK 1.3 command line switches?
|
protected boolean |
assumeJava14()
Shall we assume JDK 1.4 command line switches?
|
protected boolean |
assumeJava15()
Shall we assume JDK 1.5 command line switches?
|
protected boolean |
assumeJava16()
Shall we assume JDK 1.6 command line switches?
|
protected boolean |
assumeJava17()
Shall we assume JDK 1.7 command line switches?
|
protected boolean |
assumeJava18()
Shall we assume JDK 1.8 command line switches?
|
protected boolean |
assumeJava9()
Shall we assume JDK 9 command line switches?
|
protected int |
executeExternalCompile(String[] args,
int firstFileName)
Do the compile with the specified arguments.
|
protected int |
executeExternalCompile(String[] args,
int firstFileName,
boolean quoteFiles)
Do the compile with the specified arguments.
|
protected Path |
getBootClassPath()
Combines a user specified bootclasspath with the system
bootclasspath taking build.sysclasspath into account.
|
protected Path |
getCompileClasspath()
Builds the compilation classpath.
|
Javac |
getJavac()
Get the Javac task instance associated with this compiler adapter
|
protected Path |
getModulepath()
Builds the modulepath.
|
protected Path |
getModulesourcepath()
Builds the modulesourcepath for multi module compilation.
|
protected String |
getNoDebugArgument()
The argument the compiler wants to see if the debug attribute
has been set to false.
|
protected Project |
getProject()
Get the project this compiler adapter was created in.
|
String[] |
getSupportedFileExtensions()
By default, only recognize files with a Java extension,
but specialized compilers can recognize multiple kinds
of files.
|
protected Path |
getUpgrademodulepath()
Builds the upgrademodulepath.
|
protected void |
logAndAddFilesToCompile(Commandline cmd)
Logs the compilation parameters, adds the files to compile and logs the
"niceSourceList"
|
void |
setJavac(Javac attributes)
Set the Javac instance which contains the configured compilation
attributes.
|
protected Commandline |
setupJavacCommand()
Set up the command line.
|
protected Commandline |
setupJavacCommand(boolean debugLevelCheck)
Does the command line argument processing for classic and adds
the files to compile as well.
|
protected Commandline |
setupJavacCommandlineSwitches(Commandline cmd)
Get the command line arguments for the switches.
|
protected Commandline |
setupJavacCommandlineSwitches(Commandline cmd,
boolean useDebugLevel)
Does the command line argument processing common to classic and
modern.
|
protected Commandline |
setupModernJavacCommand()
Does the command line argument processing for modern and adds
the files to compile as well.
|
protected Commandline |
setupModernJavacCommandlineSwitches(Commandline cmd)
Does the command line argument processing for modern.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
protected Javac attributes
protected Path bootclasspath
protected Path compileClasspath
protected File[] compileList
protected Path compileSourcepath
protected boolean debug
protected boolean depend
protected boolean deprecation
protected File destDir
protected String encoding
protected Path extdirs
protected boolean includeAntRuntime
protected boolean includeJavaRuntime
protected Location location
protected static final String lSep
protected String memoryInitialSize
protected String memoryMaximumSize
protected Path modulepath
protected Path moduleSourcepath
protected boolean optimize
protected Project project
protected String release
protected Path src
protected String target
protected Path upgrademodulepath
protected boolean verbose
protected void addCurrentCompilerArgs(Commandline cmd)
cmd
- the command line to useprotected boolean assumeJava11()
protected boolean assumeJava12()
protected boolean assumeJava13()
protected boolean assumeJava14()
protected boolean assumeJava15()
protected boolean assumeJava16()
protected boolean assumeJava17()
protected boolean assumeJava18()
protected boolean assumeJava9()
protected int executeExternalCompile(String[] args, int firstFileName)
args
- - arguments to pass to process on command linefirstFileName
- - index of the first source file in args,
if the index is negative, no temporary file will ever be
created, but this may hit the command line length limit on your
system.protected int executeExternalCompile(String[] args, int firstFileName, boolean quoteFiles)
The working directory if the executed process will be the project's base directory.
args
- - arguments to pass to process on command linefirstFileName
- - index of the first source file in args,
if the index is negative, no temporary file will ever be
created, but this may hit the command line length limit on your
system.quoteFiles
- - if set to true, filenames containing
spaces will be quoted when they appear in the external file.
This is necessary when running JDK 1.4's javac and probably
others.protected Path getBootClassPath()
protected Path getCompileClasspath()
public Javac getJavac()
protected Path getModulepath()
protected Path getModulesourcepath()
protected String getNoDebugArgument()
A return value of null
means no argument at all.
protected Project getProject()
public String[] getSupportedFileExtensions()
getSupportedFileExtensions
in interface CompilerAdapterExtension
protected Path getUpgrademodulepath()
protected void logAndAddFilesToCompile(Commandline cmd)
cmd
- the command linepublic void setJavac(Javac attributes)
setJavac
in interface CompilerAdapter
attributes
- a configured Javac task.protected Commandline setupJavacCommand()
protected Commandline setupJavacCommand(boolean debugLevelCheck)
debugLevelCheck
- if true set the debug level with the -g switchprotected Commandline setupJavacCommandlineSwitches(Commandline cmd)
cmd
- the command lineprotected Commandline setupJavacCommandlineSwitches(Commandline cmd, boolean useDebugLevel)
cmd
- the command lineuseDebugLevel
- if true set set the debug level with the -g switchprotected Commandline setupModernJavacCommand()
protected Commandline setupModernJavacCommandlineSwitches(Commandline cmd)
cmd
- the command line