Exemplo n.º 1
0
  public void completeCompile(
      final IProject project,
      final IResource source,
      final OtpErlangObject compilationResult,
      final IBackend backend,
      final OtpErlangList compilerOptions) {
    if (compilationResult == null) {
      MarkerUtils.addProblemMarker(
          source, null, null, "Could not compile file", 0, IMarker.SEVERITY_ERROR);
      return;
    }
    final OtpErlangTuple t = (OtpErlangTuple) compilationResult;
    // ErlLogger.debug("** " + t);

    if ("ok".equals(((OtpErlangAtom) t.elementAt(0)).atomValue())) {
      final String beamf = source.getFullPath().removeFileExtension().lastSegment();
      InternalErlideBuilder.loadModule(project, beamf);
      refreshDirs(project, t.elementAt(2));
    } else {
      // ErlLogger.debug(">>>> compile error... %s\n   %s",
      // resource.getName(), t);
    }

    // process compilation messages
    if (t.elementAt(1) instanceof OtpErlangList) {
      final OtpErlangList l = (OtpErlangList) t.elementAt(1);
      MarkerUtils.addErrorMarkers(source, l);
    } else {
      ErlLogger.warn("bad result from builder: %s", t);
    }

    completeCompileForYrl(project, source, backend, compilerOptions);
  }