public class CompileWorker
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
private static class |
CompileWorker.CompilationJob
a compilation job
|
Modifier and Type | Field and Description |
---|---|
private java.lang.Thread |
compilationThread
We spawn a thread to perform compilation.
|
private java.util.ArrayList |
compilerArgumentsList |
private XMLElement |
compilerArgumentsSpec |
private java.lang.String |
compilerArgumentsToUse |
private java.util.ArrayList |
compilerList |
private XMLElement |
compilerSpec |
private java.lang.String |
compilerToUse |
private CompileHandler |
handler |
private AutomatedInstallData |
idata |
private java.util.ArrayList |
jobs
Compilation jobs
|
private CompileResult |
result |
private XMLElement |
spec |
private static java.lang.String |
SPEC_RESOURCE_NAME
Name of resource for specifying compilation parameters.
|
private VariableSubstitutor |
vs |
Constructor and Description |
---|
CompileWorker(AutomatedInstallData idata,
CompileHandler handler)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
changeClassPath(java.util.ArrayList classpath,
XMLElement child)
helper: process a
<classpath> tag. |
private boolean |
collectJobs()
Parse the compilation specification file and create jobs.
|
private CompileWorker.CompilationJob |
collectJobsRecursive(XMLElement node,
java.util.ArrayList classpath) |
private CompileResult |
compileJobs()
perform the actual compilation
|
java.util.ArrayList |
getAvailableArguments()
Return list of compiler arguments to choose from.
|
java.util.ArrayList |
getAvailableCompilers()
Return list of compilers to choose from.
|
java.lang.String |
getCompiler()
Get the compiler used.
|
java.lang.String |
getCompilerArguments()
Get the compiler arguments used.
|
CompileResult |
getResult()
Get the result of the compilation.
|
private void |
readChoices(XMLElement element,
java.util.ArrayList result) |
private boolean |
readSpec() |
void |
run()
This is called when the compilation thread is activated.
|
private java.util.ArrayList |
scanDirectory(java.io.File path)
helper: recursively scan given directory.
|
void |
setCompiler(java.lang.String compiler)
Set the compiler to use.
|
void |
setCompilerArguments(java.lang.String arguments)
Set the compiler arguments to use.
|
void |
startThread()
Start the compilation in a separate thread.
|
private java.util.ArrayList jobs
private static final java.lang.String SPEC_RESOURCE_NAME
private VariableSubstitutor vs
private java.lang.Thread compilationThread
private XMLElement spec
private AutomatedInstallData idata
private CompileHandler handler
private XMLElement compilerSpec
private java.util.ArrayList compilerList
private java.lang.String compilerToUse
private XMLElement compilerArgumentsSpec
private java.util.ArrayList compilerArgumentsList
private java.lang.String compilerArgumentsToUse
private CompileResult result
public CompileWorker(AutomatedInstallData idata, CompileHandler handler) throws java.io.IOException
idata
- The installation data.handler
- The handler to notify of progress.java.io.IOException
public java.util.ArrayList getAvailableCompilers()
public void setCompiler(java.lang.String compiler)
compiler
- compiler to use (not checked)public java.lang.String getCompiler()
public java.util.ArrayList getAvailableArguments()
public void setCompilerArguments(java.lang.String arguments)
public java.lang.String getCompilerArguments()
public CompileResult getResult()
public void startThread()
public void run()
run
in interface java.lang.Runnable
private boolean readSpec()
private void readChoices(XMLElement element, java.util.ArrayList result)
private boolean collectJobs() throws java.lang.Exception
java.lang.Exception
private CompileResult compileJobs()
private CompileWorker.CompilationJob collectJobsRecursive(XMLElement node, java.util.ArrayList classpath) throws java.lang.Exception
java.lang.Exception
private void changeClassPath(java.util.ArrayList classpath, XMLElement child) throws java.lang.Exception
<classpath>
tag.java.lang.Exception
private java.util.ArrayList scanDirectory(java.io.File path)