Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.compilers

public Class JavacExternal

extends DefaultCompilerAdapter
Class Inheritance
Imports
java.io.File, .IOException, java.util.Arrays, .List, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.condition.Os, org.apache.tools.ant.types.Commandline, org.apache.tools.ant.util.FileUtils, .JavaEnvUtils

Performs a compile using javac externally.
Since
Ant 1.4

Field Summary

Modifier and TypeField and Description
private static List<String>
Inherited from org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter:
attributesbootclasspathcompileClasspathcompileListcompileSourcepathdebugdependdeprecationdestDirencodingextdirsincludeAntRuntimeincludeJavaRuntimelocationlSepmemoryInitialSizememoryMaximumSizemodulepathmoduleSourcepathoptimizeprojectreleasesrctargetupgrademodulepathverbose

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
private boolean

Returns:

boolean
execOnVMS
(Commandline
Commandline
cmd
,
int
int
firstFileName
)

helper method to execute our command on VMS.

public boolean

Returns:

true if the compilation succeeded
execute
()

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

Performs a compile using the Javac externally.
private static boolean
private static boolean
private int

Returns:

int index of first argument that could be put into argfile
moveArgFileEligibleOptionsToEnd
(String[]
command line to process
commandLine
)

Moves all -J and @argfiles arguments to the beginning So that all command line arguments could be written to file, but -J and @argfile As per javac documentation: you can specify one or more files that contain arguments to the javac command (except -J options)

private static int
numberOfArgsNotEligibleForFile(String[] args, int currentIndex)

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

Field Detail

ARGS_FOLLOWED_BY_PATHback to summary
private static List<String> ARGS_FOLLOWED_BY_PATH

Constructor Detail

JavacExternalback to summary
public JavacExternal()

Method Detail

containsWildcardsback to summary
private static boolean containsWildcards(String path)
execOnVMSback to summary
private boolean execOnVMS(Commandline cmd, int firstFileName)

helper method to execute our command on VMS.

Parameters
cmd:Commandline

Commandline

firstFileName:int

int

Returns:boolean

boolean

executeback to summary
public boolean execute() throws BuildException

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

Performs a compile using the Javac externally.

Returns:boolean

true if the compilation succeeded

Annotations
@Override
Exceptions
BuildException:
on error
isArgFileEligibleback to summary
private static boolean isArgFileEligible(String option)
isArgFollowedByPathback to summary
private static boolean isArgFollowedByPath(String option)
moveArgFileEligibleOptionsToEndback to summary
private int moveArgFileEligibleOptionsToEnd(String[] commandLine)

Moves all -J and @argfiles arguments to the beginning So that all command line arguments could be written to file, but -J and @argfile As per javac documentation: you can specify one or more files that contain arguments to the javac command (except -J options)

Parameters
commandLine:String[]

command line to process

Returns:int

int index of first argument that could be put into argfile

numberOfArgsNotEligibleForFileback to summary
private static int numberOfArgsNotEligibleForFile(String[] args, int currentIndex)