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 CompilerManagerpublic final void addCompiler(Compiler compiler)
CompilerManageraddCompiler in class CompilerManager@Deprecated public void addTranslatingCompiler(TranslatingCompiler compiler, java.util.Set<FileType> inputTypes, java.util.Set<FileType> outputTypes)
CompilerManageraddTranslatingCompiler in class CompilerManagercompiler - compiler implementationinputTypes - a set of filetypes that compiler accepts as inputoutputTypes - a set of filetypes that compiler can generatepublic final void removeCompiler(Compiler compiler)
CompilerManagerremoveCompiler in class CompilerManagerpublic <T extends Compiler> T [] getCompilers(java.lang.Class<T> compilerClass)
CompilerManagergetCompilers in class CompilerManagercompilerClass - the class for which the compilers should be returned.public void addCompilableFileType(FileType type)
CompilerManageraddCompilableFileType in class CompilerManagertype - the type for which the Compile action is enabled.public void removeCompilableFileType(FileType type)
CompilerManagerremoveCompilableFileType in class CompilerManagertype - the type for which the Compile action is disabled.public boolean isCompilableFileType(FileType type)
CompilerManagerisCompilableFileType in class CompilerManagertype - the type to check.CompilerManager.addCompilableFileType(FileType)public final void addBeforeTask(CompileTask task)
CompilerManagercompiler.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 CompilerManagerpublic final void addAfterTask(CompileTask task)
CompilerManageraddAfterTask in class CompilerManagerpublic java.util.List<CompileTask> getBeforeTasks()
CompilerManagergetBeforeTasks in class CompilerManagerpublic java.util.List<CompileTask> getAfterTaskList()
CompilerManagergetAfterTaskList in class CompilerManagerpublic void compile(VirtualFile [] files, CompileStatusNotification callback)
CompilerManagercompile in class CompilerManagerfiles - 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)
CompilerManagercompile in class CompilerManagermodule - a module which sources are to be compiledcallback - a notification callback, or null if no notifications neededpublic void compile(CompileScope scope, CompileStatusNotification callback)
CompilerManagercompile in class CompilerManagerscope - a scope to be compiledcallback - a notification callback, or null if no notifications neededpublic void make(CompileStatusNotification callback)
CompilerManagermake in class CompilerManagercallback - a notification callback, or null if no notifications neededpublic void make(Module module, CompileStatusNotification callback)
CompilerManagermake in class CompilerManagermodule - 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)
CompilerManagermake in class CompilerManagerproject - a project modules belong tomodules - modules to compilecallback - a notification callback, or null if no notifications needed.public void make(CompileScope scope, CompileStatusNotification callback)
CompilerManagermake in class CompilerManagerscope - a scope to be compiledcallback - a notification callback, or null if no notifications neededpublic void makeWithModalProgress(CompileScope scope, CompileStatusNotification callback)
CompilerManagerCompilerManager.make(CompileScope, CompileStatusNotification) but with modal progress window instead of background progressmakeWithModalProgress in class CompilerManagerpublic boolean isUpToDate(CompileScope scope)
CompilerManagerisUpToDate in class CompilerManagerpublic void rebuild(CompileStatusNotification callback)
CompilerManagerrebuild in class CompilerManagercallback - a notification callback, or null if no notifications neededpublic void executeTask(CompileTask task, CompileScope scope, java.lang.String contentName, java.lang.Runnable onTaskFinished)
CompilerManagerexecuteTask in class CompilerManagertask - 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 CompilerManagerpublic void addCompilationStatusListener(CompilationStatusListener listener, Disposable parentDisposable)
addCompilationStatusListener in class CompilerManagerpublic void removeCompilationStatusListener(CompilationStatusListener listener)
removeCompilationStatusListener in class CompilerManagerpublic boolean isExcludedFromCompilation(VirtualFile file)
CompilerManagerisExcludedFromCompilation in class CompilerManagerfile - the file to check.public CompileScope createFilesCompileScope(VirtualFile [] files)
createFilesCompileScope in class CompilerManagerpublic CompileScope createModuleCompileScope(Module module, boolean includeDependentModules)
createModuleCompileScope in class CompilerManagerpublic CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules)
createModulesCompileScope in class CompilerManagerpublic CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules, boolean includeRuntimeDependencies)
createModulesCompileScope in class CompilerManagerpublic CompileScope createModuleGroupCompileScope(Project project, Module [] modules, boolean includeDependentModules)
createModuleGroupCompileScope in class CompilerManagerpublic CompileScope createProjectCompileScope(Project project)
createProjectCompileScope in class CompilerManagerpublic void setValidationEnabled(ModuleType<?> moduleType, boolean enabled)
setValidationEnabled in class CompilerManagerpublic boolean isValidationEnabled(Module module)
isValidationEnabled in class CompilerManagerpublic 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 CompilerManagerjava.io.IOExceptionCompilationExceptionpublic java.io.File getJavacCompilerWorkingDir()
getJavacCompilerWorkingDir in class CompilerManager