Esempio n. 1
0
  private void buildLibraries(
      Predicate<String> predicate, IPath outputLocation, IProgressMonitor monitor)
      throws CoreException {
    IFolder binFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(outputLocation);
    binFolder.refreshLocal(IResource.DEPTH_ONE, null);

    java.util.List<String> toCopy = Helper.getLibraryEntries(getProject());

    monitor.beginTask(Messages.Builder_copy_libraries, toCopy.size());
    for (String path : toCopy) {
      if (predicate == null || predicate.accept(path)) {
        Helper.copyLibraryToBin(getProject(), path);
      }
      monitor.worked(1);
    }
    monitor.done();
  }
Esempio n. 2
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.core.internal.events.InternalBuilder#build(int,
   * java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
   */
  @Override
  @SuppressWarnings("rawtypes")
  protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
    Helper.forcePDEEditor(getProject());

    IPath outputLocation = Helper.getOutputLocation(getProject());

    if (DEBUG) {
      String typeStr = "UNKNOWN"; // $NON-NLS-1$
      switch (kind) {
        case INCREMENTAL_BUILD:
          typeStr = "INCREMENTAL"; // $NON-NLS-1$
          break;
        case AUTO_BUILD:
          typeStr = "AUTO"; // $NON-NLS-1$
          break;
        case CLEAN_BUILD:
          typeStr = "CLEAN"; // $NON-NLS-1$
          break;
        case FULL_BUILD:
          typeStr = "FULL"; // $NON-NLS-1$
          break;
      }
      debug(
          "Build type "
              + typeStr
              + " output location: "
              + outputLocation.toString()); // $NON-NLS-1$ //$NON-NLS-2$
    }

    if (kind == CLEAN_BUILD) {
      if (DEBUG) {
        debug("Doing nothing"); // $NON-NLS-1$
      }
      return null;
    }

    if (kind == FULL_BUILD) {
      fullBuild(outputLocation, monitor);
    } else {
      IResourceDelta delta = getDelta(getProject());
      if (delta == null) {
        if (DEBUG) {
          debug(
              "Incremental build was requested but delta is null, performing full build"); //$NON-NLS-1$
        }
        fullBuild(outputLocation, monitor);
        return null;
      }

      if (!Helper.checkMETAINFFolder(getProject())) {
        if (DEBUG) {
          debug(
              "Incremental build was requested but META-INF folder is missing from output location, performing full build"); //$NON-NLS-1$
        }
        fullBuild(outputLocation, monitor);
        return null;
      }

      if (!Helper.checkLibraries(getProject())) {
        if (DEBUG) {
          debug(
              "Incremental build was requested but some classpath libraries are missing from output location, performing full build"); //$NON-NLS-1$
        }
        fullBuild(outputLocation, monitor);
        return null;
      }

      if (DEBUG) {
        debug("Incremental build"); // $NON-NLS-1$
      }
      incrementalBuild(outputLocation, delta, monitor);
      return null;
    }

    return null;
  }
Esempio n. 3
0
 private void error(String string) {
   Helper.error(getProject().getName() + " - " + string); // $NON-NLS-1$
 }
Esempio n. 4
0
 private void debug(String string) {
   Helper.debug(getProject().getName() + " - " + string); // $NON-NLS-1$
 }