Java 类org.eclipse.core.resources.IBuildConfiguration 实例源码

项目:n4js    文件:ExternalProjectBuildOrderProvider.java   
/**
 * Converts the {@link VertexOrder vertex order} into the appropriate {@link ProjectBuildConfigOrder build
 * configuration order}.
 *
 * @param order
 *            the order to convert.
 * @return the converted vertex order as a build configuration order. The returning configuration can be consumed by
 *         the Eclipse build framework.
 */
private static ProjectBuildConfigOrder vertexOrderToProjectBuildConfigOrder(final VertexOrder order) {
    final IBuildConfiguration[] buildConfigs = new IBuildConfiguration[order.vertexes.length];
    System.arraycopy(order.vertexes, 0, buildConfigs, 0, order.vertexes.length);
    final IBuildConfiguration[][] knots = new IBuildConfiguration[order.knots.length][];
    for (int i = 0; i < order.knots.length; i++) {
        knots[i] = new IBuildConfiguration[order.knots[i].length];
        System.arraycopy(order.knots[i], 0, knots[i], 0, order.knots[i].length);
    }
    return new ProjectBuildConfigOrder(buildConfigs, order.hasCycles, knots);
}
项目:n4js    文件:ExternalProjectBuildOrderProvider.java   
@Override
public int compare(final IBuildConfiguration px, final IBuildConfiguration py) {
    int cmp = py.getProject().getName().compareTo(px.getProject().getName());
    if (cmp == 0) {
        cmp = py.getName().compareTo(px.getName());
    }
    return cmp;
}
项目:n4js    文件:ExternalProject.java   
/**
 * Like {@link #getActiveBuildConfig()} but doesn't check accessibility. Project must be accessible.
 *
 * @see #getActiveBuildConfig()
 */
/* default */ IBuildConfiguration unsafeGetActiveBuildConfig() {
    String configName = internalGetDescription().getActiveBuildConfig();
    try {
        if (configName != null)
            return getBuildConfig(configName);
    } catch (CoreException e) {
        // Build configuration doesn't exist; treat the first as active.
    }
    return internalGetBuildConfigs(false)[0];
}
项目:n4js    文件:RebuildWorkspaceProjectsJob.java   
/**
 * Creates a new job with the already ordered configurations to builder.
 *
 * @param configs
 *            the configurations to build.
 *
 */
public RebuildWorkspaceProjectsJob(final IBuildConfiguration[] configs) {
    super("Building workspace");
    checkState(Platform.isRunning(), "This job requires a running platform");
    this.configs = checkNotNull(configs, "configs");
    setSystem(false);
    setUser(true);
    setRule(BUILD_RULE);
}
项目:n4js    文件:RebuildWorkspaceProjectsScheduler.java   
/**
 * Schedules a build with the given projects. Does nothing if the {@link Platform platform} is not running, or the
 * iterable of projects is empty.
 *
 * @param toUpdate
 *            an iterable of projects to build.
 */
public void scheduleBuildIfNecessary(final Iterable<IProject> toUpdate) {
    if (Platform.isRunning() && !Iterables.isEmpty(toUpdate)) {
        final Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace();
        final IBuildConfiguration[] projectsToReBuild = from(asList(workspace.getBuildOrder()))
                .filter(config -> Iterables.contains(toUpdate, config.getProject()))
                .toArray(IBuildConfiguration.class);

        if (!Arrays2.isEmpty(projectsToReBuild)) {
            new RebuildWorkspaceProjectsJob(projectsToReBuild).schedule();
        }
    }
}
项目:n4js    文件:N4JSExternalProject.java   
@Override
public IBuildConfiguration[] internalGetReferencedBuildConfigs(final String configName,
        final boolean includeMissing) {

    final IBuildConfiguration[] filteredConfigs = from(referencedBuildConfigs)
            .filter(config -> !includeMissing ? config.getProject().exists() : true)
            .toArray(IBuildConfiguration.class);
    return filteredConfigs;
}
项目:hybris-commerce-eclipse-plugin    文件:EclipseRefreshAndBuildHandler.java   
private void refreshAndFullBuild(IProgressMonitor monitor) throws InvocationTargetException {

    List<IProject> projects = Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects());
    boolean isAutoBuildEnabled = isAutoBuildEnabled();  
     try
     {
         if (isAutoBuildEnabled)
         {
             enableAutoBuild(false);
         }

        // refresh all projects one by one  
        for (IProject project : projects)
        {
            if (project.isOpen())
            {
                project.refreshLocal(IResource.DEPTH_INFINITE, null);
            }
        }
        // do a full build
        ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
        IBuildConfiguration[] platformBuildConfig = { ResourcesPlugin.getWorkspace().newBuildConfig("platform","platform-build")};
        // build the platform first since other projects depend on it
        ResourcesPlugin.getWorkspace().build(platformBuildConfig, IncrementalProjectBuilder.FULL_BUILD, true, monitor);
        ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
      }
      catch (CoreException e)
      {
        Activator.logError("Failed to synchronize with the platform", e);
        throw new InvocationTargetException(e);
      }
     if (isAutoBuildEnabled)
     {
         enableAutoBuild(true);
     }
}
项目:che    文件:Workspace.java   
@Override
public void build(
    IBuildConfiguration[] iBuildConfigurations,
    int i,
    boolean b,
    IProgressMonitor iProgressMonitor)
    throws CoreException {
  throw new UnsupportedOperationException();
}
项目:goclipse    文件:LangProjectBuilder.java   
protected boolean isFirstProjectOfKind() throws CoreException {
    for (IBuildConfiguration buildConfig : getContext().getAllReferencedBuildConfigs()) {
        if(buildConfig.getProject().hasNature(LangCore.NATURE_ID)) {
            return false;
        }
    }
    return true;
}
项目:goclipse    文件:LangProjectBuilder.java   
protected boolean isLastProjectOfKind() throws CoreException {
    for (IBuildConfiguration buildConfig : getContext().getAllReferencingBuildConfigs()) {
        if(buildConfig.getProject().hasNature(LangCore.NATURE_ID)) {
            return false;
        }
    }
    return true;
}
项目:n4js    文件:ExternalProject.java   
@Override
public IBuildConfiguration getActiveBuildConfig() throws CoreException {
    return new BuildConfiguration(this);
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
private void doPerformOperation(final IBuildConfiguration[] configs, final BuildOperation operation,
        final IProgressMonitor monitor) {

    if (Arrays2.isEmpty(configs)) {
        return;
    }

    final ISchedulingRule rule = getRule();
    try {
        Job.getJobManager().beginRule(rule, monitor);

        final List<ExternalProject> projects = transform(configs, config -> (ExternalProject) config.getProject());
        final List<IBuildConfiguration> buildOrder = newArrayList(getBuildOrder(projects));
        if (BuildOperation.CLEAN.equals(operation)) {
            Collections.reverse(buildOrder);
        }

        // Remove external projects that have the workspace counterpart if it is a build operation.
        if (BuildOperation.BUILD.equals(operation)) {
            for (final Iterator<IBuildConfiguration> itr = buildOrder.iterator(); itr.hasNext(); /**/) {
                if (hasWorkspaceCounterpart(itr.next())) {
                    itr.remove();
                }
            }
        }

        checkState(buildOrder.size() == configs.length,
                "Inconsistency between build configuration and the ordered projects:" +
                        "\n\tInput was: " + getProjectNames(configs) +
                        "\n\tOrdered was: " + getProjectNames(buildOrder));

        ensureDynamicDependenciesSetForWorkspaceProjects();
        final String prefix = Strings.toFirstUpper(operation.toString().toLowerCase());
        final String projectNames = getProjectNames(buildOrder);
        LOGGER.info(prefix + "ing external libraries: " + projectNames);
        final SubMonitor subMonitor = SubMonitor.convert(monitor, buildOrder.size());
        for (final IBuildConfiguration configuration : buildOrder) {
            final IProject project = configuration.getProject();
            LOGGER.info(prefix + "ing external library: " + project.getName());
            operation.run(this, project, subMonitor.newChild(1));
        }
    } finally {
        Job.getJobManager().endRule(rule);
    }
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
/**
 * Returns with {@code true} if the external project is accessible in the workspace as well.
 */
private boolean hasWorkspaceCounterpart(IBuildConfiguration config) {
    final URI uri = URI.createPlatformResourceURI(config.getProject().getName(), true);
    final IN4JSProject n4Project = core.findProject(uri).orNull();
    return null != n4Project && n4Project.exists() && !n4Project.isExternal();
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
private String getProjectNames(final Iterable<IBuildConfiguration> buildOrder) {
    return Iterables.toString(from(buildOrder).transform(c -> c.getProject().getName()));
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
private String getProjectNames(final IBuildConfiguration[] buildOrder) {
    return Iterables.toString(transform(buildOrder, c -> c.getProject().getName()));
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
private IBuildConfiguration getBuildConfiguration(final IProject project) {
    return TO_CONFIG_FUNC.apply(project);
}
项目:che    文件:Project.java   
@Override
public void build(
    IBuildConfiguration iBuildConfiguration, int i, IProgressMonitor iProgressMonitor)
    throws CoreException {
  throw new UnsupportedOperationException();
}
项目:che    文件:Project.java   
@Override
public IBuildConfiguration getActiveBuildConfig() throws CoreException {
  throw new UnsupportedOperationException();
}
项目:che    文件:Project.java   
@Override
public IBuildConfiguration getBuildConfig(String s) throws CoreException {
  throw new UnsupportedOperationException();
}
项目:che    文件:Project.java   
@Override
public IBuildConfiguration[] getBuildConfigs() throws CoreException {
  throw new UnsupportedOperationException();
}
项目:che    文件:Project.java   
@Override
public IBuildConfiguration[] getReferencedBuildConfigs(String s, boolean b) throws CoreException {
  throw new UnsupportedOperationException();
}
项目:che    文件:Workspace.java   
@Override
public IBuildConfiguration newBuildConfig(String s, String s1) {
  throw new UnsupportedOperationException();
}
项目:PerformanceHat    文件:AbstractProjectDecorator.java   
/**
 * {@inheritDoc}
 */
@Override
public void build(final IBuildConfiguration config, final int kind, final IProgressMonitor monitor) throws CoreException {
  resource().build(config, kind, monitor);
}
项目:PerformanceHat    文件:AbstractProjectDecorator.java   
/**
 * {@inheritDoc}
 */
@Override
public IBuildConfiguration getActiveBuildConfig() throws CoreException {
  return resource().getActiveBuildConfig();
}
项目:PerformanceHat    文件:AbstractProjectDecorator.java   
/**
 * {@inheritDoc}
 */
@Override
public IBuildConfiguration getBuildConfig(final String configName) throws CoreException {
  return resource().getBuildConfig(configName);
}
项目:PerformanceHat    文件:AbstractProjectDecorator.java   
/**
 * {@inheritDoc}
 */
@Override
public IBuildConfiguration[] getBuildConfigs() throws CoreException {
  return resource().getBuildConfigs();
}
项目:PerformanceHat    文件:AbstractProjectDecorator.java   
/**
 * {@inheritDoc}
 */
@Override
public IBuildConfiguration[] getReferencedBuildConfigs(final String configName, final boolean includeMissing) throws CoreException {
  return resource().getReferencedBuildConfigs(configName, includeMissing);
}
项目:Pydev    文件:AbstractIProjectStub.java   
@Override
public void build(IBuildConfiguration config, int kind, IProgressMonitor monitor) throws CoreException {
    throw new RuntimeException("Not implemented");
}
项目:Pydev    文件:AbstractIProjectStub.java   
@Override
public IBuildConfiguration getActiveBuildConfig() throws CoreException {
    throw new RuntimeException("Not implemented");
}
项目:Pydev    文件:AbstractIProjectStub.java   
@Override
public IBuildConfiguration getBuildConfig(String configName) throws CoreException {
    throw new RuntimeException("Not implemented");
}
项目:Pydev    文件:AbstractIProjectStub.java   
@Override
public IBuildConfiguration[] getBuildConfigs() throws CoreException {
    throw new RuntimeException("Not implemented");
}
项目:Pydev    文件:AbstractIProjectStub.java   
@Override
public IBuildConfiguration[] getReferencedBuildConfigs(String configName, boolean includeMissing)
        throws CoreException {
    throw new RuntimeException("Not implemented");
}
项目:n4js    文件:ExternalProjectBuildOrderProvider.java   
/**
 * Computes the build order among specified projects given as the argument.
 *
 * @param projects
 *            the projects.
 * @return the build order as an array of build configuration instances.
 */
public static IBuildConfiguration[] getBuildOrder(final Iterable<ExternalProject> projects) {
    return vertexOrderToProjectBuildConfigOrder(computeActiveBuildConfigOrder(projects)).buildConfigurations;
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
/**
 * Performs a full build on the given project. Same as {@link #build(IProject)} but a monitor can be provided for
 * the running process.
 *
 * @param project
 *            the project to build.
 * @param monitor
 *            the monitor for the full build operation.
 */
public void build(final IProject project, final IProgressMonitor monitor) {
    build(new IBuildConfiguration[] { new BuildConfiguration(project) }, monitor);
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
/**
 * Full builds the projects given as an array of build configuration.
 * <p>
 * For information on locking see {@link #getRule()}.
 *
 * @param buildConfigs
 *            the build configurations representing the projects to be built.
 * @param monitor
 *            the monitor for the progress. Must not be {@code null}.
 *
 * @throws IllegalArgumentException
 *             if a scheduling rule is in effect that does not contain the rule returned by {@link #getRule()}. For
 *             more info, see {@link #getRule() here}.
 */
public void build(final IBuildConfiguration[] buildConfigs, final IProgressMonitor monitor) {
    doPerformOperation(buildConfigs, BuildOperation.BUILD, monitor);
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
/**
 * Cleans the given project. Same as {@link #clean(IProject)} but additional {@link IProgressMonitor monitor} can be
 * provided for the operation.
 *
 * @param project
 *            the project that has to be cleaned (without rebuilding it).
 * @param monitor
 *            monitor for the clean process.
 */
public void clean(final IProject project, final IProgressMonitor monitor) {
    clean(new IBuildConfiguration[] { getBuildConfiguration(project) }, monitor);
}
项目:n4js    文件:ExternalLibraryBuilderHelper.java   
/**
 * Performs a clean (without rebuild) on the projects given as an array of build configuration. The clean order is
 * identical with the order of the elements in the {@code buildOrder} argument.
 * <p>
 * For information on locking see {@link #getRule()}.
 *
 * @param buildConfigs
 *            the build configurations representing the the projects to be cleaned.
 * @param monitor
 *            the monitor for the progress. Must not be {@code null}.
 *
 * @throws IllegalArgumentException
 *             if a scheduling rule is in effect that does not contain the rule returned by {@link #getRule()}. For
 *             more info, see {@link #getRule() here}.
 */
public void clean(final IBuildConfiguration[] buildConfigs, final IProgressMonitor monitor) {
    doPerformOperation(buildConfigs, BuildOperation.CLEAN, monitor);
}
项目:n4js    文件:N4JSExternalProject.java   
/**
 * Attach the argument as a referenced build configuration to the project.
 *
 * @param config
 *            the configuration to attach.
 * @return {@link Set#add(Object)}.
 */
boolean add(final IBuildConfiguration config) {
    return referencedBuildConfigs.add(config);
}