Search in sources :

Example 1 with JavacCompiler

use of com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler in project intellij-community by JetBrains.

the class CompilerConfigurationImpl method createCompilers.

private void createCompilers() {
    if (JAVAC_EXTERNAL_BACKEND != null) {
        return;
    }
    JAVAC_EXTERNAL_BACKEND = new JavacCompiler(myProject);
    myRegisteredCompilers.add(JAVAC_EXTERNAL_BACKEND);
    if (!ApplicationManager.getApplication().isUnitTestMode()) {
        if (EclipseCompiler.isInitialized()) {
            final EclipseCompiler eclipse = new EclipseCompiler(myProject);
            myRegisteredCompilers.add(eclipse);
        }
    }
    final Set<FileType> types = new HashSet<>();
    for (BackendCompiler compiler : Extensions.getExtensions(BackendCompiler.EP_NAME, myProject)) {
        myRegisteredCompilers.add(compiler);
        types.addAll(compiler.getCompilableFileTypes());
    }
    final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
    for (FileType type : types) {
        compilerManager.addCompilableFileType(type);
    }
    myDefaultJavaCompiler = JAVAC_EXTERNAL_BACKEND;
    for (BackendCompiler compiler : myRegisteredCompilers) {
        if (compiler.getId().equals(myState.DEFAULT_COMPILER)) {
            myDefaultJavaCompiler = compiler;
            break;
        }
    }
    myState.DEFAULT_COMPILER = myDefaultJavaCompiler.getId();
}
Also used : EclipseCompiler(com.intellij.compiler.impl.javaCompiler.eclipse.EclipseCompiler) JavacCompiler(com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler) FileType(com.intellij.openapi.fileTypes.FileType) CompilerManager(com.intellij.openapi.compiler.CompilerManager) BackendCompiler(com.intellij.compiler.impl.javaCompiler.BackendCompiler)

Aggregations

BackendCompiler (com.intellij.compiler.impl.javaCompiler.BackendCompiler)1 EclipseCompiler (com.intellij.compiler.impl.javaCompiler.eclipse.EclipseCompiler)1 JavacCompiler (com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler)1 CompilerManager (com.intellij.openapi.compiler.CompilerManager)1 FileType (com.intellij.openapi.fileTypes.FileType)1