Package com.intellij.openapi.compiler

Examples of com.intellij.openapi.compiler.CompilerManager


    public HaskellCompilerProjectComponent(Project project) {
        super(project);
    }

    public void projectOpened() {
        CompilerManager manager = CompilerManager.getInstance(myProject);
        for (HaskellCompiler compiler : manager.getCompilers(HaskellCompiler.class)) {
            manager.removeCompiler(compiler);
        }
        HashSet<FileType> inputSet = new HashSet<FileType>(Arrays.asList(HaskellFileType.INSTANCE));
        HashSet<FileType> outputSet = new HashSet<FileType>(Arrays.asList(HiFileType.INSTANCE));
        manager.addTranslatingCompiler(new HaskellCompiler(myProject), inputSet, outputSet);
        //CompilerWorkspaceConfiguration.getInstance(myProject).USE_OUT_OF_PROCESS_BUILD = false;
    }
View Full Code Here


    _project = project;
  }


  public void compile(final VirtualFile[] virtualFiles, @Nullable final CompileStatusNotification notification) {
    final CompilerManager compilerManager = CompilerManager.getInstance(_project);
    try {
      if (IdeaUtilImpl.isVersionGreaterThanIdea9()) {
        final Method method = compilerManager.getClass().getDeclaredMethod("compile", VirtualFile[].class, CompileStatusNotification.class);
        method.invoke(virtualFiles, notification);
      } else {
        final Method method = compilerManager.getClass().getDeclaredMethod("compile", VirtualFile[].class, CompileStatusNotification.class, boolean.class);
        method.invoke(virtualFiles, notification, false);
      }
    } catch (final NoSuchMethodException e) {
      LOGGER.debug(e);
    } catch (final InvocationTargetException e) {
View Full Code Here

        myProject = project;
    }

    @Override
    public void projectOpened() {
        CompilerManager compilerManager = CompilerManager.getInstance(myProject);
        compilerManager.addCompilableFileType(PbFileType.PROTOBUF_FILE_TYPE);
        compilerManager.addBeforeTask(new PbPrecompileTask());
        compilerManager.addCompiler(new PbCompiler(myProject));
    }
View Full Code Here

    @Override
    public void apply() throws ConfigurationException {
        boolean isCompilationCheckboxEnabled = commonSettingsEditor.getEnableCompilationCheckbox().isSelected();
        configuration.setIsCompilationEnabled(isCompilationCheckboxEnabled);
        if (isCompilationCheckboxEnabled && !configuration.isCompilationEnabled()) {
            CompilerManager compilerManager = CompilerManager.getInstance(project);
            compilerManager.addCompilableFileType(PbFileType.PROTOBUF_FILE_TYPE);
            CompilerManager.getInstance(project).addCompiler(new PbCompiler(project));
        } else if (!isCompilationCheckboxEnabled && configuration.isCompilationEnabled()) {
            CompilerManager compilerManager = CompilerManager.getInstance(project);
            compilerManager.removeCompilableFileType(PbFileType.PROTOBUF_FILE_TYPE);
            for (PbCompiler compiler : compilerManager.getCompilers(PbCompiler.class)) {
                compilerManager.removeCompiler(compiler);
            }
        }

        configuration.setCompilerOutputPath(commonSettingsEditor.getProtobufCompilerOutputPathField().getText().trim());
    }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.compiler.CompilerManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.