Gcj (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.compilers, class: Gcj

# Class Gcj

java.lang.Object
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter
org.apache.tools.ant.taskdefs.compilers.Gcj

All Implemented Interfaces:
  `CompilerAdapter, CompilerAdapterExtension`

public class Gcj extends DefaultCompilerAdapter
The implementation of the gcj compiler. This is primarily a cut-and-paste from the jikes.

Since:
  Ant 1.4

- ## Field Summary

  ### Fields inherited from class 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`
  Modifier and Type
  Field
  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 final String`
  `lSep`
  Deprecated.
  `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 Summary

  Constructors
  Constructor
  Description
  `Gcj()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `execute()`
  Performs a compile using the gcj compiler.
  `boolean`
  `isNativeBuild()`
  Whether any of the arguments given via <compilerarg> implies that compilation to native code is requested.
  `protected Commandline`
  `setupGCJCommand()`
  Set up the gcj commandline.

  ### Methods inherited from class 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`
  Modifier and Type
  Method
  Description
  `protected void`
  `addCurrentCompilerArgs(Commandline cmd)`
  Adds the command line arguments specific to the current implementation.
  `protected void`
  `addExtdirsToClasspath(Path classpath)`
  Deprecated.
  since 1.5.x.
  `protected boolean`
  `assumeJava1_1Plus()`
  Shall we assume JDK 1.1+ command line switches?
  `protected boolean`
  `assumeJava1_2Plus()`
  Shall we assume JDK 1.2+ command line switches?
  `protected boolean`
  `assumeJava1_3Plus()`
  Shall we assume JDK 1.3+ command line switches?
  `protected boolean`
  `assumeJava1_4Plus()`
  Shall we assume JDK 1.4+ command line switches?
  `protected boolean`
  `assumeJava1_5Plus()`
  Shall we assume JDK 1.5+ command line switches?
  `protected boolean`
  `assumeJava1_6Plus()`
  Shall we assume JDK 1.6+ command line switches?
  `protected boolean`
  `assumeJava1_7Plus()`
  Shall we assume JDK 1.7+ command line switches?
  `protected boolean`
  `assumeJava1_8Plus()`
  Shall we assume JDK 1.8+ command line switches?
  `protected boolean`
  `assumeJava10Plus()`
  Shall we assume JDK 10+ command line switches?
  `protected boolean`
  `assumeJava11()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_1Plus, if necessary combined with !assumeJava1_2Plus
  `protected boolean`
  `assumeJava12()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_2Plus, if necessary combined with !assumeJava1_3Plus
  `protected boolean`
  `assumeJava13()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_3Plus, if necessary combined with !assumeJava1_4Plus
  `protected boolean`
  `assumeJava14()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_4Plus, if necessary combined with !assumeJava1_5Plus
  `protected boolean`
  `assumeJava15()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_5Plus, if necessary combined with !assumeJava1_6Plus
  `protected boolean`
  `assumeJava16()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_6Plus, if necessary combined with !assumeJava1_7Plus
  `protected boolean`
  `assumeJava17()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_7Plus, if necessary combined with !assumeJava1_8Plus
  `protected boolean`
  `assumeJava18()`
  Deprecated.
  since Ant 1.10.7, use assumeJava1_8Plus, if necessary combined with !assumeJava9Plus
  `protected boolean`
  `assumeJava19()`
  Deprecated.
  use #assumeJava9 instead
  `protected boolean`
  `assumeJava9()`
  Deprecated.
  since Ant 1.10.7, use assumeJava9Plus, in the future if necessary combined with !assumeJava10Plus
  `protected boolean`
  `assumeJava9Plus()`
  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.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Gcj

    public Gcj()

- ## Method Details

  - ### execute

    public boolean execute() throws BuildException
    Performs a compile using the gcj compiler.
    Returns:
      true if the compilation succeeded
    Throws:
      `BuildException` - on error

  - ### setupGCJCommand

    protected Commandline setupGCJCommand()
    Set up the gcj commandline.
    Returns:
      the command line

  - ### isNativeBuild

    public boolean isNativeBuild()
    Whether any of the arguments given via <compilerarg> implies that compilation to native code is requested.
    Returns:
      true if compilation to native code is requested
    Since:
      Ant 1.6.2