Top Description Fields Constructors Methods
org.codehaus.janino

public Class AntCompilerAdapter

extends DefaultCompilerAdapter
Class Inheritance
Imports
java.io.File, .IOException, java.nio.charset.Charset, org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter, org.apache.tools.ant.types.Path, org.codehaus.commons.compiler.CompileException, .ICompiler, org.codehaus.commons.nullanalysis.Nullable

A simple org.apache.tools.ant.taskdefs.compilers.CompilerAdapter for the "ant" tool that silently ignores most of the configuration parameters and attempts to compile all given source files into class files.

Field Summary

Inherited from org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter:
attributesbootclasspathcompileClasspathcompileListcompileSourcepathdebugdependdeprecationdestDirencodingextdirsincludeAntRuntimeincludeJavaRuntimelocationlSepmemoryInitialSizememoryMaximumSizemodulepathmoduleSourcepathoptimizeprojectreleasesrctargetupgrademodulepathverbose

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

"true" on success
execute
()

Implements org.apache.tools.ant.taskdefs.compilers.CompilerAdapter.execute.

Compiles all source files in DefaultCompilerAdapter.compileList individually and creates class files in the DefaultCompilerAdapter.destDir.
private static File[]

Returns:

The converted path, or null if path is null
pathToFiles
(Path path)

Converts a org.apache.tools.ant.types.Path into an array of Files.

private static File[]

Returns:

The converted path, or, if path is null, the defaultValue
pathToFiles
(Path path, File[] defaultValue)

Converts a org.apache.tools.ant.types.Path into an array of Files.

Inherited from org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter:
addCurrentCompilerArgsaddExtdirsToClasspathassumeJava10PlusassumeJava11assumeJava12assumeJava13assumeJava14assumeJava15assumeJava16assumeJava17assumeJava18assumeJava19assumeJava1_1PlusassumeJava1_2PlusassumeJava1_3PlusassumeJava1_4PlusassumeJava1_5PlusassumeJava1_6PlusassumeJava1_7PlusassumeJava1_8PlusassumeJava9assumeJava9PlusexecuteExternalCompileexecuteExternalCompilegetBootClassPathgetCompileClasspathgetJavacgetModulepathgetModulesourcepathgetNoDebugArgumentgetProjectgetSupportedFileExtensionsgetUpgrademodulepathlogAndAddFilesToCompilesetJavacsetupJavacCommandsetupJavacCommandsetupJavacCommandlineSwitchessetupJavacCommandlineSwitchessetupModernJavacCommandsetupModernJavacCommandlineSwitches

Constructor Detail

AntCompilerAdapterback to summary
public AntCompilerAdapter()

Method Detail

executeback to summary
public boolean execute()

Implements org.apache.tools.ant.taskdefs.compilers.CompilerAdapter.execute.

Compiles all source files in DefaultCompilerAdapter.compileList individually and creates class files in the DefaultCompilerAdapter.destDir.

The following fields of DefaultCompilerAdapter are honored:

  • DefaultCompilerAdapter.compileList - the set of Java source files to compile
  • DefaultCompilerAdapter.destDir - where to store the class files
  • DefaultCompilerAdapter.compileSourcepath - where to look for more Java source files
  • DefaultCompilerAdapter.compileClasspath - where to look for required classes
  • DefaultCompilerAdapter.extdirs
  • DefaultCompilerAdapter.bootclasspath
  • DefaultCompilerAdapter.encoding - how the Java source files are encoded
  • DefaultCompilerAdapter.verbose
  • DefaultCompilerAdapter.debug
  • org.apache.tools.ant.taskdefs.Javac.getDebugLevel()
  • DefaultCompilerAdapter.src

The following fields of DefaultCompilerAdapter are not honored at this time:

  • DefaultCompilerAdapter.depend
  • DefaultCompilerAdapter.deprecation
  • DefaultCompilerAdapter.includeAntRuntime
  • DefaultCompilerAdapter.includeJavaRuntime
  • DefaultCompilerAdapter.location
  • DefaultCompilerAdapter.optimize
  • DefaultCompilerAdapter.target
Returns:boolean

"true" on success

Annotations
@Override
pathToFilesback to summary
private static File[] pathToFiles(Path path)

Converts a org.apache.tools.ant.types.Path into an array of Files.

Returns:File[]

The converted path, or null if path is null

pathToFilesback to summary
private static File[] pathToFiles(Path path, File[] defaultValue)

Converts a org.apache.tools.ant.types.Path into an array of Files.

Returns:File[]

The converted path, or, if path is null, the defaultValue