public class CompileArguments
extends java.lang.Object
Compiler.compile(CompileArguments)
entrypoint. Code
that wants to use compile services calls any desired setters
and the build system will call any getters it's interested in.Constructor and Description |
---|
CompileArguments(Context context)
Create a new CompileArguments object.
|
Modifier and Type | Method and Description |
---|---|
void |
addJavaCompilerOption(java.lang.String option,
java.lang.String argument)
Add a Java compiler option which will be appended at the end of
the options for the Java compiler
|
void |
addJavaCompilerOptions(java.lang.String options)
Add the options to be appended to the options for the Java compiler.
|
boolean |
getClearLogBeforeCompile()
Deprecated.
Since 12.1.2.0.0, use
isClearLogBeforeCompile() |
Context |
getContext()
Get the Context that defines the targets that will be compiled.
|
java.io.OutputStream |
getDiagnosticsStream()
Get the OutputStream for compilation diagnostics if those diagnostics need
to be redirected.
|
java.util.Map<java.lang.String,java.lang.String> |
getJavaCompilerOptions()
Get the options to be appended to the options for the Java compiler.
|
java.io.OutputStream |
getOutputStream()
Get the OutputStream for compilation output (any non-diagnostic output) if
that output needs to be redirected.
|
PostBuilder |
getPostBuilder()
The PostBuilder which will be used after the compilation has finished.
|
boolean |
isClearLogBeforeCompile()
Get the clear log before compile setting.
|
boolean |
isCompileDependencies()
Determine if the build should compile the project's dependencies first before
a project compile.
|
boolean |
isCompileDependentProjects()
Deprecated.
Use
isCompileDependencies() instead |
boolean |
isForceRebuildOnProjectChanges()
Determine if the build should turn a 'build' into a 'rebuild' IFF the project
settings were changed since the last build of the project.
|
boolean |
isQuiet()
Determine if the build shows it progress, meaning the names of the files
compiled and written.
|
boolean |
isRebuildAllSources()
If true, only the sources specified by the context are compiled;
if false, the specified sources and all sources that depend on those
sources compiled ( a 'make' ).
|
boolean |
isSaveBeforeCompiling()
If true, AND the IDE setting to save before compile is true (see
Preferences | Compiler | Save All before Compiling), a save-all is
issued before the compilation.
|
boolean |
isThrowOnConcurrentCleanOrCompile()
Determine if the build system should throw a
IllegalStateException when
it is already busy with another clean or compile, instead of
reporting the failure on the output and diagnostics
streams or on stdout and stderr if the streams are not set. |
boolean |
isWaitForTermination()
If true, the compile call will not return till the compile is finished; if
false, the compile call will return immediately.
|
boolean |
isWaitOnConcurrentCleanOrCompile()
Determine if the build system should wait for a concurrent clean or
compile to finish before executing this build.
|
void |
setClearLogBeforeCompile(boolean clearLogBeforeCompile)
Override the clear log before compile setting in IDE preferences
just for this compile
|
void |
setCompileDepdendentProjects(boolean compileDependencies)
Deprecated.
Use
setCompileDependencies(boolean) instead |
void |
setCompileDependencies(boolean compileDependencies)
Set the compile dependencies flag, which indicates if dependencies
should be compiled before a project is compiled.
|
void |
setDiagnosticsStream(java.io.OutputStream diagnosticsStream)
Set the output stream that should be used for diagnostics.
|
void |
setForceRebuildOnProjectChanges(boolean forceRebuildOnProjectChanges)
Update the setting to make the build turn a 'build' into a 'rebuild' IFF the project
settings were changed since the last build of the project.
|
void |
setOutputStream(java.io.OutputStream outputStream)
Set the output stream that should be used for compilation output (any
non-diagnostic output).
|
void |
setPostBuilder(PostBuilder postBuilder)
Set the PostBuilder that will be used after the compilation.
|
void |
setQuiet(boolean quiet)
Update the setting that determines if the build shows its progress, meaning
the names of the files compiled and written.
|
void |
setRebuildAllSources(boolean rebuildAllSources)
Set the rebuild all sources flag.
|
void |
setSaveBeforeCompiling(boolean saveBeforeCompiling)
Set the save before compiling flag.
|
void |
setThrowOnConcurrentCleanOrCompile(boolean throwOnConcurrentCleanOrCompile)
Update the setting that determines if the build system should throw
a
IllegalStateException when it is already busy with another
clean or compile, instead of reporting the failure on the output
and diagnostics streams or on stdout and stderr if the streams
are not set. |
void |
setWaitForTermination(boolean waitForTermination)
Set the wait for termination flag.
|
void |
setWaitOnConcurrentCleanOrCompile(boolean waitOnConcurrentCleanOrCompile)
Update the setting that determines if the build system should wait
for a concurrent clean or compile to finish before executing this build.
|
public CompileArguments(Context context)
context
- The context that defines what will be compiled, which
cannot be null. To compile one target, such as a Workspace or a Project,
use Context.setNode(oracle.ide.model.Node)
. To compile multiple
targets, use Context.setSelection(oracle.ide.model.Element[])
java.lang.IllegalArgumentException
- if context is nullpublic Context getContext()
public boolean isRebuildAllSources()
public void setRebuildAllSources(boolean rebuildAllSources)
rebuildAllSources
- The flag that indicates if all sources should
be rebuild or not. For a rebuild, use true, for a make, use falsepublic boolean isSaveBeforeCompiling()
public void setSaveBeforeCompiling(boolean saveBeforeCompiling)
saveBeforeCompiling
- The save before compiling flagpublic boolean isWaitForTermination()
public void setWaitForTermination(boolean waitForTermination)
waitForTermination
- The new flag@Deprecated public boolean isCompileDependentProjects()
isCompileDependencies()
insteadpublic boolean isCompileDependencies()
@Deprecated public void setCompileDepdendentProjects(boolean compileDependencies)
setCompileDependencies(boolean)
insteadcompileDependencies
- The new flagpublic void setCompileDependencies(boolean compileDependencies)
compileDependencies
- The new flagpublic java.io.OutputStream getOutputStream()
public void setOutputStream(java.io.OutputStream outputStream)
outputStream
- The output stream to be used for compilation outputpublic java.io.OutputStream getDiagnosticsStream()
public void setDiagnosticsStream(java.io.OutputStream diagnosticsStream)
diagnosticsStream
- The output stream to be used for diagnosticspublic PostBuilder getPostBuilder()
public void setPostBuilder(PostBuilder postBuilder)
postBuilder
- The PostBuilder to be used after the compilation@Deprecated public boolean getClearLogBeforeCompile()
isClearLogBeforeCompile()
public boolean isClearLogBeforeCompile()
public void setClearLogBeforeCompile(boolean clearLogBeforeCompile)
clearLogBeforeCompile
- The clear log before compile setting
for this compile onlypublic void addJavaCompilerOption(java.lang.String option, java.lang.String argument)
option
- An option which cannot be null or emptyargument
- An optional argument for the option which can be nulljava.lang.IllegalArgumentException
- for an invalid optionpublic java.util.Map<java.lang.String,java.lang.String> getJavaCompilerOptions()
public void addJavaCompilerOptions(java.lang.String options)
options
- A specially formatted string containing optionspublic void setForceRebuildOnProjectChanges(boolean forceRebuildOnProjectChanges)
forceRebuildOnProjectChanges
- If true, build will turn a 'build' into
a 'rebuild'public boolean isForceRebuildOnProjectChanges()
public void setQuiet(boolean quiet)
quiet
- If true, the build does not show its progresspublic boolean isQuiet()
public void setThrowOnConcurrentCleanOrCompile(boolean throwOnConcurrentCleanOrCompile)
IllegalStateException
when it is already busy with another
clean or compile, instead of reporting the failure on the output
and diagnostics streams or on stdout and stderr if the streams
are not set. False by default. If this setting is true, the
isWaitOnConcurrentCleanOrCompile()
setting is ignored.throwOnConcurrentCleanOrCompile
- The new settingpublic boolean isThrowOnConcurrentCleanOrCompile()
IllegalStateException
when
it is already busy with another clean or compile, instead of
reporting the failure on the output and diagnostics
streams or on stdout and stderr if the streams are not set.
False by default. If this setting is true, the
isWaitOnConcurrentCleanOrCompile()
setting is ignored.public void setWaitOnConcurrentCleanOrCompile(boolean waitOnConcurrentCleanOrCompile)
isThrowOnConcurrentCleanOrCompile()
setting is true.waitOnConcurrentCleanOrCompile
- The new settingpublic boolean isWaitOnConcurrentCleanOrCompile()
isThrowOnConcurrentCleanOrCompile()
setting is true.