public class CompileContextImpl extends UserDataHolderBase implements CompileContextEx
Constructor and Description |
---|
CompileContextImpl(Project project,
CompilerTask compilerSession,
CompileScope compileScope,
boolean isMake,
boolean isRebuild) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(CompilerMessage msg) |
void |
addMessage(CompilerMessageCategory category,
java.lang.String message,
java.lang.String url,
int lineNum,
int columnNum)
Allows to add a message to be shown in Compiler message view.
|
void |
addMessage(CompilerMessageCategory category,
java.lang.String message,
java.lang.String url,
int lineNum,
int columnNum,
Navigatable navigatable)
Allows to add a message to be shown in Compiler message view, with a specified Navigatable
that is used to navigate to the error location.
|
void |
addScope(CompileScope additionalScope) |
CompilerTask |
getBuildSession() |
CompileScope |
getCompileScope()
Returns the current compile scope.
|
int |
getMessageCount(CompilerMessageCategory category)
Returns the count of messages of the specified category added during the current compile session.
|
CompilerMessage [] |
getMessages(CompilerMessageCategory category)
Returns all messages of the specified category added during the current compile session.
|
Module |
getModuleByFile(VirtualFile file)
Returns the module to which the specified file belongs.
|
VirtualFile |
getModuleOutputDirectory(Module module)
Returns the output directory for the specified module.
|
VirtualFile |
getModuleOutputDirectoryForTests(Module module)
Returns the test output directory for the specified module.
|
ProgressIndicator |
getProgressIndicator()
Returns the progress indicator of the compilation process.
|
Project |
getProject() |
CompileScope |
getProjectCompileScope()
Returns the compile scope which would be used if the entire project was rebuilt.
|
java.lang.String |
getRebuildReason() |
java.util.UUID |
getSessionId() |
long |
getStartCompilationStamp() |
boolean |
isAnnotationProcessorsEnabled() |
boolean |
isAutomake() |
boolean |
isMake()
Checks if the compilation is incremental, i.e.
|
boolean |
isRebuild() |
boolean |
isRebuildRequested() |
void |
requestRebuildNextTime(java.lang.String message)
A compiler may call this method in order to request complete project rebuild.
|
boolean |
shouldUpdateProblemsView() |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUserData, putUserData
public CompileContextImpl(Project project, CompilerTask compilerSession, CompileScope compileScope, boolean isMake, boolean isRebuild)
public CompilerTask getBuildSession()
public boolean shouldUpdateProblemsView()
public long getStartCompilationStamp()
public Project getProject()
getProject
in interface CompileContext
public CompilerMessage [] getMessages(CompilerMessageCategory category)
CompileContext
getMessages
in interface CompileContext
category
- the category for which messages are requested.public void addMessage(CompilerMessageCategory category, java.lang.String message, java.lang.String url, int lineNum, int columnNum)
CompileContext
addMessage
in interface CompileContext
category
- the category of a message (information, error, warning).message
- the text of the message.url
- a url to the file to which the message applies, null if not available.lineNum
- a line number, -1 if not available.columnNum
- a column number, -1 if not available.public void addMessage(CompilerMessageCategory category, java.lang.String message, java.lang.String url, int lineNum, int columnNum, Navigatable navigatable)
CompileContext
addMessage
in interface CompileContext
category
- the category of a message (information, error, warning).message
- the text of the message.url
- a url to the file to which the message applies, null if not available.lineNum
- a line number, -1 if not available.columnNum
- a column number, -1 if not available.navigatable
- the navigatable pointing to the error location.public void addMessage(CompilerMessage msg)
addMessage
in interface CompileContextEx
public int getMessageCount(CompilerMessageCategory category)
CompileContext
getMessageCount
in interface CompileContext
category
- the category for which messages are requested.public CompileScope getCompileScope()
CompileContext
getCompileScope
in interface CompileContext
public CompileScope getProjectCompileScope()
CompileContext
CompileContext.getCompileScope()
may return the scope, that is more narrow than ProjectCompileScope.getProjectCompileScope
in interface CompileContext
public void requestRebuildNextTime(java.lang.String message)
CompileContext
requestRebuildNextTime
in interface CompileContext
public boolean isRebuildRequested()
isRebuildRequested
in interface CompileContext
public java.lang.String getRebuildReason()
getRebuildReason
in interface CompileContext
public ProgressIndicator getProgressIndicator()
CompileContext
getProgressIndicator
in interface CompileContext
public Module getModuleByFile(VirtualFile file)
CompileContext
getModuleByFile
in interface CompileContext
file
- the file to check.public VirtualFile getModuleOutputDirectory(Module module)
CompileContext
getModuleOutputDirectory
in interface CompileContext
module
- the module to check.public VirtualFile getModuleOutputDirectoryForTests(Module module)
CompileContext
getModuleOutputDirectoryForTests
in interface CompileContext
module
- the module to check.public boolean isMake()
CompileContext
isMake
in interface CompileContext
public boolean isAutomake()
isAutomake
in interface CompileContext
public boolean isRebuild()
isRebuild
in interface CompileContext
public boolean isAnnotationProcessorsEnabled()
isAnnotationProcessorsEnabled
in interface CompileContext
public void addScope(CompileScope additionalScope)
addScope
in interface CompileContextEx
public java.util.UUID getSessionId()