Class AntCompilerAdapter

java.lang.Object
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter
org.codehaus.janino.AntCompilerAdapter
All Implemented Interfaces:
org.apache.tools.ant.taskdefs.compilers.CompilerAdapter, org.apache.tools.ant.taskdefs.compilers.CompilerAdapterExtension

public class AntCompilerAdapter extends org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter
A simple 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

    Fields inherited from class org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter

    attributes, bootclasspath, compileClasspath, compileList, compileSourcepath, debug, depend, deprecation, destDir, encoding, extdirs, includeAntRuntime, includeJavaRuntime, location, lSep, memoryInitialSize, memoryMaximumSize, modulepath, moduleSourcepath, optimize, project, release, src, target, upgrademodulepath, verbose
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compiles all source files in DefaultCompilerAdapter.compileList individually and creates class files in the DefaultCompilerAdapter.destDir.
    private static File[]
    pathToFiles(org.apache.tools.ant.types.Path path)
    Converts a Path into an array of Files.
    private static File[]
    pathToFiles(org.apache.tools.ant.types.Path path, File[] defaultValue)
    Converts a Path into an array of Files.

    Methods inherited from class org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter

    addCurrentCompilerArgs, addExtdirsToClasspath, assumeJava1_1Plus, assumeJava1_2Plus, assumeJava1_3Plus, assumeJava1_4Plus, assumeJava1_5Plus, assumeJava1_6Plus, assumeJava1_7Plus, assumeJava1_8Plus, assumeJava10Plus, assumeJava11, assumeJava12, assumeJava13, assumeJava14, assumeJava15, assumeJava16, assumeJava17, assumeJava18, assumeJava19, assumeJava9, assumeJava9Plus, executeExternalCompile, executeExternalCompile, getBootClassPath, getCompileClasspath, getJavac, getModulepath, getModulesourcepath, getNoDebugArgument, getProject, getSupportedFileExtensions, getUpgrademodulepath, logAndAddFilesToCompile, setJavac, setupJavacCommand, setupJavacCommand, setupJavacCommandlineSwitches, setupJavacCommandlineSwitches, setupModernJavacCommand, setupModernJavacCommandlineSwitches

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AntCompilerAdapter

      public AntCompilerAdapter()
  • Method Details

    • execute

      public boolean 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:
      "true" on success
    • pathToFiles

      private static File[] pathToFiles(@Nullable org.apache.tools.ant.types.Path path)
      Converts a Path into an array of Files.
      Returns:
      The converted path, or null if path is null
    • pathToFiles

      private static File[] pathToFiles(@Nullable org.apache.tools.ant.types.Path path, File[] defaultValue)
      Converts a Path into an array of Files.
      Returns:
      The converted path, or, if path is null, the defaultValue