public class CompilerManagerImpl extends CompilerManager
NOTIFICATION_GROUP, RUN_CONFIGURATION_KEY, RUN_CONFIGURATION_TYPE_ID_KEY
Constructor and Description |
---|
CompilerManagerImpl(Project project) |
CompilerManagerImpl(Project project,
MessageBus messageBus)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addAfterTask(CompileTask task)
Registers a compiler task that will be executed after the compilation.
|
void |
addBeforeTask(CompileTask task)
Registers a compiler task that will be executed before the compilation.
|
void |
addCompilableFileType(FileType type)
Registers the type as a compilable type so that Compile action will be enabled on files of this type.
|
void |
addCompilationStatusListener(CompilationStatusListener listener) |
void |
addCompilationStatusListener(CompilationStatusListener listener,
Disposable parentDisposable) |
void |
addCompiler(Compiler compiler)
Registers a custom compiler.
|
void |
addTranslatingCompiler(TranslatingCompiler compiler,
java.util.Set<FileType> inputTypes,
java.util.Set<FileType> outputTypes)
Deprecated.
|
boolean |
awaitNettyThreadPoolTermination(long time,
java.util.concurrent.TimeUnit unit) |
void |
compile(CompileScope scope,
CompileStatusNotification callback)
Compile all files from the scope given.
|
void |
compile(Module module,
CompileStatusNotification callback)
Compile all sources (including test sources) from the module.
|
void |
compile(VirtualFile [] files,
CompileStatusNotification callback)
Compile a set of files.
|
java.util.Collection<ClassObject> |
compileJavaCode(java.util.List<java.lang.String> options,
java.util.Collection<? extends java.io.File> platformCp,
java.util.Collection<? extends java.io.File> classpath,
java.util.Collection<? extends java.io.File> upgradeModulePath,
java.util.Collection<? extends java.io.File> modulePath,
java.util.Collection<? extends java.io.File> sourcePath,
java.util.Collection<? extends java.io.File> files,
java.io.File outputDir) |
CompileScope |
createFilesCompileScope(VirtualFile [] files) |
CompileScope |
createModuleCompileScope(Module module,
boolean includeDependentModules) |
CompileScope |
createModuleGroupCompileScope(Project project,
Module [] modules,
boolean includeDependentModules) |
CompileScope |
createModulesCompileScope(Module [] modules,
boolean includeDependentModules) |
CompileScope |
createModulesCompileScope(Module [] modules,
boolean includeDependentModules,
boolean includeRuntimeDependencies) |
CompileScope |
createProjectCompileScope(Project project) |
void |
executeTask(CompileTask task,
CompileScope scope,
java.lang.String contentName,
java.lang.Runnable onTaskFinished)
Execute a custom compile task.
|
java.util.List<CompileTask> |
getAfterTaskList()
Returns the list of all tasks to be executed after compilation.
|
java.util.List<CompileTask> |
getBeforeTasks()
Returns the list of all tasks to be executed before compilation.
|
java.util.concurrent.Semaphore |
getCompilationSemaphore() |
<T extends Compiler> |
getCompilers(java.lang.Class<T> compilerClass)
Returns all registered compilers of the specified class.
|
java.io.File |
getJavacCompilerWorkingDir() |
boolean |
isCompilableFileType(FileType type)
Checks if files of the specified type can be compiled by one of registered compilers.
|
boolean |
isCompilationActive() |
boolean |
isExcludedFromCompilation(VirtualFile file)
Checks if the specified file is excluded from compilation.
|
boolean |
isUpToDate(CompileScope scope)
Checks if compile scope given is up-to-date
|
boolean |
isValidationEnabled(Module module) |
void |
make(CompileScope scope,
CompileStatusNotification callback)
Compile all modified files and all files that depend on them from the scope given.
|
void |
make(CompileStatusNotification callback)
Compile all modified files and all files that depend on them all over the project.
|
void |
make(Module module,
CompileStatusNotification callback)
Compile all modified files and all files that depend on them from the given module and all modules this module depends on recursively.
|
void |
make(Project project,
Module [] modules,
CompileStatusNotification callback)
Compile all modified files and all files that depend on them from the modules and all modules these modules depend on recursively.
|
void |
makeWithModalProgress(CompileScope scope,
CompileStatusNotification callback)
Same as
CompilerManager.make(CompileScope, CompileStatusNotification) but with modal progress window instead of background progress |
void |
rebuild(CompileStatusNotification callback)
Rebuild the whole project from scratch.
|
void |
removeCompilableFileType(FileType type)
Unregisters the type as a compilable type so that Compile action will be disabled on files of this type.
|
void |
removeCompilationStatusListener(CompilationStatusListener listener) |
void |
removeCompiler(Compiler compiler)
Unregisters a custom compiler.
|
void |
setValidationEnabled(ModuleType<?> moduleType,
boolean enabled) |
boolean |
waitForExternalJavacToTerminate(long time,
java.util.concurrent.TimeUnit unit) |
getAfterTasks, getInstance
@Deprecated public CompilerManagerImpl(Project project, MessageBus messageBus)
public CompilerManagerImpl(Project project)
public boolean waitForExternalJavacToTerminate(long time, java.util.concurrent.TimeUnit unit)
public boolean awaitNettyThreadPoolTermination(long time, java.util.concurrent.TimeUnit unit)
public java.util.concurrent.Semaphore getCompilationSemaphore()
public boolean isCompilationActive()
isCompilationActive
in class CompilerManager
public final void addCompiler(Compiler compiler)
CompilerManager
addCompiler
in class CompilerManager
@Deprecated public void addTranslatingCompiler(TranslatingCompiler compiler, java.util.Set<FileType> inputTypes, java.util.Set<FileType> outputTypes)
CompilerManager
addTranslatingCompiler
in class CompilerManager
compiler
- compiler implementationinputTypes
- a set of filetypes that compiler accepts as inputoutputTypes
- a set of filetypes that compiler can generatepublic final void removeCompiler(Compiler compiler)
CompilerManager
removeCompiler
in class CompilerManager
public <T extends Compiler> T [] getCompilers(java.lang.Class<T> compilerClass)
CompilerManager
getCompilers
in class CompilerManager
compilerClass
- the class for which the compilers should be returned.public void addCompilableFileType(FileType type)
CompilerManager
addCompilableFileType
in class CompilerManager
type
- the type for which the Compile action is enabled.public void removeCompilableFileType(FileType type)
CompilerManager
removeCompilableFileType
in class CompilerManager
type
- the type for which the Compile action is disabled.public boolean isCompilableFileType(FileType type)
CompilerManager
isCompilableFileType
in class CompilerManager
type
- the type to check.CompilerManager.addCompilableFileType(FileType)
public final void addBeforeTask(CompileTask task)
CompilerManager
compiler.task
extension point instead
(see CompileTask
for details), this way you won't need to call this method during project's initialization.addBeforeTask
in class CompilerManager
public final void addAfterTask(CompileTask task)
CompilerManager
addAfterTask
in class CompilerManager
public java.util.List<CompileTask> getBeforeTasks()
CompilerManager
getBeforeTasks
in class CompilerManager
public java.util.List<CompileTask> getAfterTaskList()
CompilerManager
getAfterTaskList
in class CompilerManager
public void compile(VirtualFile [] files, CompileStatusNotification callback)
CompilerManager
compile
in class CompilerManager
files
- a list of files to compile. If a VirtualFile is a directory, all containing files are processed.
Compiler excludes are not honored.callback
- a notification callback, or null if no notifications needed.public void compile(Module module, CompileStatusNotification callback)
CompilerManager
compile
in class CompilerManager
module
- a module which sources are to be compiledcallback
- a notification callback, or null if no notifications neededpublic void compile(CompileScope scope, CompileStatusNotification callback)
CompilerManager
compile
in class CompilerManager
scope
- a scope to be compiledcallback
- a notification callback, or null if no notifications neededpublic void make(CompileStatusNotification callback)
CompilerManager
make
in class CompilerManager
callback
- a notification callback, or null if no notifications neededpublic void make(Module module, CompileStatusNotification callback)
CompilerManager
make
in class CompilerManager
module
- a module which sources are to be compiled.callback
- a notification callback, or null if no notifications needed.public void make(Project project, Module [] modules, CompileStatusNotification callback)
CompilerManager
make
in class CompilerManager
project
- a project modules belong tomodules
- modules to compilecallback
- a notification callback, or null if no notifications needed.public void make(CompileScope scope, CompileStatusNotification callback)
CompilerManager
make
in class CompilerManager
scope
- a scope to be compiledcallback
- a notification callback, or null if no notifications neededpublic void makeWithModalProgress(CompileScope scope, CompileStatusNotification callback)
CompilerManager
CompilerManager.make(CompileScope, CompileStatusNotification)
but with modal progress window instead of background progressmakeWithModalProgress
in class CompilerManager
public boolean isUpToDate(CompileScope scope)
CompilerManager
isUpToDate
in class CompilerManager
public void rebuild(CompileStatusNotification callback)
CompilerManager
rebuild
in class CompilerManager
callback
- a notification callback, or null if no notifications neededpublic void executeTask(CompileTask task, CompileScope scope, java.lang.String contentName, java.lang.Runnable onTaskFinished)
CompilerManager
executeTask
in class CompilerManager
task
- the task to execute.scope
- compile scope for which the task is executed.contentName
- the name of a tab in message view where the execution results will be displayed.onTaskFinished
- a runnable to be executed when the task finishes, null if nothing should be executed.public void addCompilationStatusListener(CompilationStatusListener listener)
addCompilationStatusListener
in class CompilerManager
public void addCompilationStatusListener(CompilationStatusListener listener, Disposable parentDisposable)
addCompilationStatusListener
in class CompilerManager
public void removeCompilationStatusListener(CompilationStatusListener listener)
removeCompilationStatusListener
in class CompilerManager
public boolean isExcludedFromCompilation(VirtualFile file)
CompilerManager
isExcludedFromCompilation
in class CompilerManager
file
- the file to check.public CompileScope createFilesCompileScope(VirtualFile [] files)
createFilesCompileScope
in class CompilerManager
public CompileScope createModuleCompileScope(Module module, boolean includeDependentModules)
createModuleCompileScope
in class CompilerManager
public CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules)
createModulesCompileScope
in class CompilerManager
public CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules, boolean includeRuntimeDependencies)
createModulesCompileScope
in class CompilerManager
public CompileScope createModuleGroupCompileScope(Project project, Module [] modules, boolean includeDependentModules)
createModuleGroupCompileScope
in class CompilerManager
public CompileScope createProjectCompileScope(Project project)
createProjectCompileScope
in class CompilerManager
public void setValidationEnabled(ModuleType<?> moduleType, boolean enabled)
setValidationEnabled
in class CompilerManager
public boolean isValidationEnabled(Module module)
isValidationEnabled
in class CompilerManager
public java.util.Collection<ClassObject> compileJavaCode(java.util.List<java.lang.String> options, java.util.Collection<? extends java.io.File> platformCp, java.util.Collection<? extends java.io.File> classpath, java.util.Collection<? extends java.io.File> upgradeModulePath, java.util.Collection<? extends java.io.File> modulePath, java.util.Collection<? extends java.io.File> sourcePath, java.util.Collection<? extends java.io.File> files, java.io.File outputDir) throws java.io.IOException, CompilationException
compileJavaCode
in class CompilerManager
java.io.IOException
CompilationException
public java.io.File getJavacCompilerWorkingDir()
getJavacCompilerWorkingDir
in class CompilerManager