public abstract class CompilerManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static NotificationGroup |
NOTIFICATION_GROUP |
static Key<RunConfiguration> |
RUN_CONFIGURATION_KEY |
static Key<java.lang.String> |
RUN_CONFIGURATION_TYPE_ID_KEY |
Constructor and Description |
---|
CompilerManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addAfterTask(CompileTask task)
Deprecated.
Use
compiler.task extension point instead (see CompileTask for details). |
abstract void |
addBeforeTask(CompileTask task)
Registers a compiler task that will be executed before the compilation.
|
abstract void |
addCompilableFileType(FileType type)
Registers the type as a compilable type so that Compile action will be enabled on files of this type.
|
abstract void |
addCompilationStatusListener(CompilationStatusListener listener)
Deprecated.
Use
CompilerTopics.COMPILATION_STATUS instead |
abstract void |
addCompilationStatusListener(CompilationStatusListener listener,
Disposable parentDisposable)
Deprecated.
Use
CompilerTopics.COMPILATION_STATUS instead |
abstract void |
addCompiler(Compiler compiler)
Deprecated.
use
CompileTask extension instead |
abstract void |
addTranslatingCompiler(TranslatingCompiler compiler,
java.util.Set<FileType> inputTypes,
java.util.Set<FileType> outputTypes)
Deprecated.
this method is part of the obsolete build system which runs as part of the IDE process. Since IDEA 12 plugins need to
integrate into 'external build system' instead (https://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins).
Since IDEA 13 users cannot switch to the old build system via UI and it will be completely removed in IDEA 14.
|
abstract void |
compile(CompileScope scope,
CompileStatusNotification callback)
Compile all files from the scope given.
|
abstract void |
compile(Module module,
CompileStatusNotification callback)
Compile all sources (including test sources) from the module.
|
abstract void |
compile(VirtualFile [] files,
CompileStatusNotification callback)
Compile a set of files.
|
abstract 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) |
abstract CompileScope |
createFilesCompileScope(VirtualFile [] files) |
abstract CompileScope |
createModuleCompileScope(Module module,
boolean includeDependentModules) |
abstract CompileScope |
createModuleGroupCompileScope(Project project,
Module [] modules,
boolean includeDependentModules) |
abstract CompileScope |
createModulesCompileScope(Module [] modules,
boolean includeDependentModules) |
abstract CompileScope |
createModulesCompileScope(Module [] modules,
boolean includeDependentModules,
boolean includeRuntimeDependencies) |
abstract CompileScope |
createProjectCompileScope(Project project) |
abstract void |
executeTask(CompileTask task,
CompileScope scope,
java.lang.String contentName,
java.lang.Runnable onTaskFinished)
Execute a custom compile task.
|
abstract java.util.List<CompileTask> |
getAfterTaskList()
Returns the list of all tasks to be executed after compilation.
|
CompileTask [] |
getAfterTasks()
Deprecated.
|
abstract java.util.List<CompileTask> |
getBeforeTasks()
Returns the list of all tasks to be executed before compilation.
|
abstract <T extends Compiler> |
getCompilers(java.lang.Class<T> compilerClass)
Returns all registered compilers of the specified class.
|
static CompilerManager |
getInstance(Project project)
Returns the compiler manager instance for the specified project.
|
abstract java.io.File |
getJavacCompilerWorkingDir() |
abstract boolean |
isCompilableFileType(FileType type)
Checks if files of the specified type can be compiled by one of registered compilers.
|
abstract boolean |
isCompilationActive() |
abstract boolean |
isExcludedFromCompilation(VirtualFile file)
Checks if the specified file is excluded from compilation.
|
abstract boolean |
isUpToDate(CompileScope scope)
Checks if compile scope given is up-to-date
|
abstract boolean |
isValidationEnabled(Module moduleType) |
abstract void |
make(CompileScope scope,
CompileStatusNotification callback)
Compile all modified files and all files that depend on them from the scope given.
|
abstract void |
make(CompileStatusNotification callback)
Compile all modified files and all files that depend on them all over the project.
|
abstract 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.
|
abstract 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.
|
abstract void |
makeWithModalProgress(CompileScope scope,
CompileStatusNotification callback)
Same as
make(CompileScope, CompileStatusNotification) but with modal progress window instead of background progress |
abstract void |
rebuild(CompileStatusNotification callback)
Rebuild the whole project from scratch.
|
abstract void |
removeCompilableFileType(FileType type)
Unregisters the type as a compilable type so that Compile action will be disabled on files of this type.
|
abstract void |
removeCompilationStatusListener(CompilationStatusListener listener)
Deprecated.
Use
CompilerTopics.COMPILATION_STATUS instead |
abstract void |
removeCompiler(Compiler compiler)
Deprecated.
use
CompileTask extension instead |
abstract void |
setValidationEnabled(ModuleType<?> moduleType,
boolean enabled) |
public static final Key<RunConfiguration> RUN_CONFIGURATION_KEY
public static final Key<java.lang.String> RUN_CONFIGURATION_TYPE_ID_KEY
public static final NotificationGroup NOTIFICATION_GROUP
public static CompilerManager getInstance(Project project)
project
- the project for which the manager is requested.public abstract boolean isCompilationActive()
@Deprecated public abstract void addCompiler(Compiler compiler)
CompileTask
extension instead@Deprecated public abstract void addTranslatingCompiler(TranslatingCompiler compiler, java.util.Set<FileType> inputTypes, java.util.Set<FileType> outputTypes)
compiler
- compiler implementationinputTypes
- a set of filetypes that compiler accepts as inputoutputTypes
- a set of filetypes that compiler can generate@Deprecated public abstract void removeCompiler(Compiler compiler)
CompileTask
extension insteadpublic abstract <T extends Compiler> T [] getCompilers(java.lang.Class<T> compilerClass)
compilerClass
- the class for which the compilers should be returned.public abstract void addCompilableFileType(FileType type)
type
- the type for which the Compile action is enabled.public abstract void removeCompilableFileType(FileType type)
type
- the type for which the Compile action is disabled.public abstract boolean isCompilableFileType(FileType type)
type
- the type to check.addCompilableFileType(FileType)
public abstract void addBeforeTask(CompileTask task)
compiler.task
extension point instead
(see CompileTask
for details), this way you won't need to call this method during project's initialization.@Deprecated public abstract void addAfterTask(CompileTask task)
compiler.task
extension point instead (see CompileTask
for details).public abstract java.util.List<CompileTask> getBeforeTasks()
@Deprecated public CompileTask [] getAfterTasks()
getAfterTaskList()
public abstract java.util.List<CompileTask> getAfterTaskList()
public abstract void compile(VirtualFile [] files, CompileStatusNotification callback)
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 abstract void compile(Module module, CompileStatusNotification callback)
module
- a module which sources are to be compiledcallback
- a notification callback, or null if no notifications neededpublic abstract void compile(CompileScope scope, CompileStatusNotification callback)
scope
- a scope to be compiledcallback
- a notification callback, or null if no notifications neededpublic abstract void make(CompileStatusNotification callback)
callback
- a notification callback, or null if no notifications neededpublic abstract void make(Module module, CompileStatusNotification callback)
module
- a module which sources are to be compiled.callback
- a notification callback, or null if no notifications needed.public abstract void make(Project project, Module [] modules, CompileStatusNotification callback)
project
- a project modules belong tomodules
- modules to compilecallback
- a notification callback, or null if no notifications needed.public abstract void make(CompileScope scope, CompileStatusNotification callback)
scope
- a scope to be compiledcallback
- a notification callback, or null if no notifications neededpublic abstract void makeWithModalProgress(CompileScope scope, CompileStatusNotification callback)
make(CompileScope, CompileStatusNotification)
but with modal progress window instead of background progresspublic abstract boolean isUpToDate(CompileScope scope)
scope
- public abstract void rebuild(CompileStatusNotification callback)
callback
- a notification callback, or null if no notifications neededpublic abstract void executeTask(CompileTask task, CompileScope scope, java.lang.String contentName, java.lang.Runnable onTaskFinished)
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.@Deprecated public abstract void addCompilationStatusListener(CompilationStatusListener listener)
CompilerTopics.COMPILATION_STATUS
instead@Deprecated public abstract void addCompilationStatusListener(CompilationStatusListener listener, Disposable parentDisposable)
CompilerTopics.COMPILATION_STATUS
instead@Deprecated public abstract void removeCompilationStatusListener(CompilationStatusListener listener)
CompilerTopics.COMPILATION_STATUS
insteadpublic abstract boolean isExcludedFromCompilation(VirtualFile file)
file
- the file to check.public abstract CompileScope createFilesCompileScope(VirtualFile [] files)
public abstract CompileScope createModuleCompileScope(Module module, boolean includeDependentModules)
public abstract CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules)
public abstract CompileScope createModulesCompileScope(Module [] modules, boolean includeDependentModules, boolean includeRuntimeDependencies)
public abstract CompileScope createModuleGroupCompileScope(Project project, Module [] modules, boolean includeDependentModules)
public abstract CompileScope createProjectCompileScope(Project project)
public abstract void setValidationEnabled(ModuleType<?> moduleType, boolean enabled)
public abstract boolean isValidationEnabled(Module moduleType)
public abstract 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
java.io.IOException
CompilationException
public abstract java.io.File getJavacCompilerWorkingDir()