Search in sources :

Example 1 with BackendCompiler

use of com.intellij.compiler.impl.javaCompiler.BackendCompiler 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)

Example 2 with BackendCompiler

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

the class BuildManager method shouldIncludeEclipseCompiler.

private boolean shouldIncludeEclipseCompiler(CompilerConfiguration config) {
    if (config instanceof CompilerConfigurationImpl) {
        final BackendCompiler javaCompiler = ((CompilerConfigurationImpl) config).getDefaultCompiler();
        final String compilerId = javaCompiler != null ? javaCompiler.getId() : null;
        return JavaCompilers.ECLIPSE_ID.equals(compilerId) || JavaCompilers.ECLIPSE_EMBEDDED_ID.equals(compilerId);
    }
    return true;
}
Also used : CompilerConfigurationImpl(com.intellij.compiler.CompilerConfigurationImpl) BackendCompiler(com.intellij.compiler.impl.javaCompiler.BackendCompiler)

Aggregations

BackendCompiler (com.intellij.compiler.impl.javaCompiler.BackendCompiler)2 CompilerConfigurationImpl (com.intellij.compiler.CompilerConfigurationImpl)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