public abstract class CommandLineCompiler extends AbstractCompiler
objDir, workDirDEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID| Modifier | Constructor and Description |
|---|---|
protected |
CommandLineCompiler(String command,
String identifierArg,
String[] sourceExtensions,
String[] headerExtensions,
String outputSuffix,
boolean libtool,
CommandLineCompiler libtoolCompiler,
boolean newEnvironment,
org.apache.tools.ant.types.Environment env) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addImpliedArgs(Vector<String> args,
boolean debug,
boolean multithreaded,
boolean exceptions,
LinkType linkType,
Boolean rtti,
OptimizationEnum optimization) |
protected void |
addIncludes(String baseDirPath,
File[] includeDirs,
Vector<String> args,
Vector<String> relativeArgs,
StringBuffer includePathId,
boolean isSystem)
Adds command-line arguments for include directories.
|
protected abstract void |
addWarningSwitch(Vector<String> args,
int warnings) |
protected void |
buildDefineArguments(CompilerDef[] defs,
Vector<String> args) |
void |
compile(CCTask task,
File outputDir,
String[] sourceFiles,
String[] args,
String[] endArgs,
boolean relentless,
CommandLineCompilerConfiguration config,
ProgressMonitor monitor)
Compiles a source file.
|
protected CompilerConfiguration |
createConfiguration(CCTask task,
LinkType linkType,
ProcessorDef[] baseDefs,
CompilerDef specificDef,
TargetDef targetPlatform,
VersionInfo versionInfo) |
protected int |
getArgumentCountPerInputFile() |
protected String |
getCommand() |
String |
getCommandWithPath(CommandLineCompilerConfiguration config) |
protected abstract void |
getDefineSwitch(StringBuffer buffer,
String define,
String value) |
protected abstract File[] |
getEnvironmentIncludePath() |
String |
getIdentifier()
Retrieve an identifier that identifies the specific version of the
compiler.
|
protected abstract String |
getIncludeDirSwitch(String source) |
protected String |
getIncludeDirSwitch(String source,
boolean isSystem)
Added by Darren Sargent 22Oct2008 Returns the include dir switch value.
|
protected String |
getInputFileArgument(File outputDir,
String filename,
int index) |
protected boolean |
getLibtool() |
CommandLineCompiler |
getLibtoolCompiler()
Obtains the same compiler, but with libtool set
Default behavior is to ignore libtool
|
abstract int |
getMaximumCommandLength() |
protected int |
getMaximumInputFilesPerCommand() |
String[] |
getOutputFileNames(String inputFile,
VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
|
protected int |
getTotalArgumentLengthForInputFile(File outputDir,
String inputFile)
Get total command line length due to the input file.
|
protected abstract void |
getUndefineSwitch(StringBuffer buffer,
String define) |
protected int |
runCommand(CCTask task,
File workingDir,
String[] cmdline)
This method is exposed so test classes can overload and test the
arguments without actually spawning the compiler
|
protected void |
setCommand(String command) |
canParse, createConfiguration, createParser, getBaseOutputName, getOutputSuffix, parseIncludes, resolveInclude, setObjDir, setWorkDirbid, changeEnvironment, clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, isWindows, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbid, changeEnvironment, getLinkerprotected abstract void addImpliedArgs(Vector<String> args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization)
protected void addIncludes(String baseDirPath, File[] includeDirs, Vector<String> args, Vector<String> relativeArgs, StringBuffer includePathId, boolean isSystem)
baseDirPath - Base directory path.includeDirs - Array of include directory pathsargs - Vector of command line arguments used to execute the taskrelativeArgs - Vector of command line arguments used to build the
configuration identifierprotected void buildDefineArguments(CompilerDef[] defs, Vector<String> args)
public String[] getOutputFileNames(String inputFile, VersionInfo versionInfo)
ProcessorgetOutputFileNames in interface ProcessorgetOutputFileNames in class AbstractCompilerinputFile - input filepublic void compile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionprotected CompilerConfiguration createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseDefs, CompilerDef specificDef, TargetDef targetPlatform, VersionInfo versionInfo)
createConfiguration in class AbstractCompilerprotected int getArgumentCountPerInputFile()
protected final String getCommand()
public String getCommandWithPath(CommandLineCompilerConfiguration config)
protected abstract void getDefineSwitch(StringBuffer buffer, String define, String value)
protected abstract File[] getEnvironmentIncludePath()
public String getIdentifier()
ProcessorgetIdentifier in interface ProcessorgetIdentifier in class AbstractProcessorprotected String getIncludeDirSwitch(String source, boolean isSystem)
source - the given source value.isSystem - "true" if this is a system include pathprotected String getInputFileArgument(File outputDir, String filename, int index)
protected final boolean getLibtool()
public final CommandLineCompiler getLibtoolCompiler()
public abstract int getMaximumCommandLength()
protected int getMaximumInputFilesPerCommand()
protected int getTotalArgumentLengthForInputFile(File outputDir, String inputFile)
outputDir - File output directoryinputFile - String input fileprotected abstract void getUndefineSwitch(StringBuffer buffer, String define)
protected int runCommand(CCTask task, File workingDir, String[] cmdline) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionprotected final void setCommand(String command)
Copyright © 2005-2016 NAR Maven Plugin developers. All Rights Reserved.