当前位置: 首页>>代码示例>>Java>>正文


Java IProjectDescription.setBuildSpec方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.IProjectDescription.setBuildSpec方法的典型用法代码示例。如果您正苦于以下问题:Java IProjectDescription.setBuildSpec方法的具体用法?Java IProjectDescription.setBuildSpec怎么用?Java IProjectDescription.setBuildSpec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.IProjectDescription的用法示例。


在下文中一共展示了IProjectDescription.setBuildSpec方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(MinifyBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(MinifyBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
开发者ID:mnlipp,项目名称:EclipseMinifyBuilder,代码行数:20,代码来源:MinifyNature.java

示例2: deconfigure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void deconfigure() throws CoreException {
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(MinifyBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			return;
		}
	}
}
 
开发者ID:mnlipp,项目名称:EclipseMinifyBuilder,代码行数:17,代码来源:MinifyNature.java

示例3: configure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GemocSequentialLanguageBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(GemocSequentialLanguageBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:19,代码来源:GemocSequentialLanguageNature.java

示例4: createProject

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
protected void createProject ( final IProgressMonitor monitor ) throws CoreException
{
    monitor.beginTask ( "Create project", 2 );

    final IProject project = this.info.getProject ();

    final IProjectDescription desc = project.getWorkspace ().newProjectDescription ( project.getName () );
    desc.setLocation ( this.info.getProjectLocation () );
    desc.setNatureIds ( new String[] { Constants.PROJECT_NATURE_CONFIGURATION, PROJECT_NATURE_JS } );

    final ICommand jsCmd = desc.newCommand ();
    jsCmd.setBuilderName ( BUILDER_JS_VALIDATOR );

    final ICommand localBuilder = desc.newCommand ();
    localBuilder.setBuilderName ( Constants.PROJECT_BUILDER );

    desc.setBuildSpec ( new ICommand[] { jsCmd, localBuilder } );

    if ( !project.exists () )
    {
        project.create ( desc, new SubProgressMonitor ( monitor, 1 ) );
        project.open ( new SubProgressMonitor ( monitor, 1 ) );
    }
    monitor.done ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:26,代码来源:CreateProjectOperation.java

示例5: createFeatureProject

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
private void createFeatureProject ( final IProject project, final Map<String, String> properties, final IProgressMonitor monitor ) throws CoreException
{
    monitor.beginTask ( "Creating feature project", 6 );

    final String name = this.pluginId + ".feature"; //$NON-NLS-1$
    final IProjectDescription desc = project.getWorkspace ().newProjectDescription ( name );

    final ICommand featureBuilder = desc.newCommand ();
    featureBuilder.setBuilderName ( "org.eclipse.pde.FeatureBuilder" ); //$NON-NLS-1$

    desc.setNatureIds ( new String[] { "org.eclipse.pde.FeatureNature" } ); //$NON-NLS-1$
    desc.setBuildSpec ( new ICommand[] {
            featureBuilder
    } );

    final IProject newProject = project.getWorkspace ().getRoot ().getProject ( name );
    newProject.create ( desc, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    newProject.open ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1

    addFilteredResource ( newProject, "pom.xml", getResource ( "feature-pom.xml" ), "UTF-8", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "feature.xml", getResource ( "feature/feature.xml" ), "UTF-8", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "feature.properties", getResource ( "feature/feature.properties" ), "ISO-8859-1", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "build.properties", getResource ( "feature/build.properties" ), "ISO-8859-1", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1

    monitor.done ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:ClientTemplate.java

示例6: removeBuilderFromProject

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
public static void removeBuilderFromProject(IProjectDescription description)
{
	// Look for builder.
	int index = -1;
	ICommand[] cmds = description.getBuildSpec();
	for( int j = 0; j < cmds.length; j++ )
	{
		if( cmds[j].getBuilderName().equals(BUILDER_ID) )
		{
			index = j;
			break;
		}
	}
	if( index == -1 )
		return;

	// Remove builder from project.
	List<ICommand> newCmds = new ArrayList<ICommand>();
	newCmds.addAll(Arrays.asList(cmds));
	newCmds.remove(index);
	description.setBuildSpec(newCmds.toArray(new ICommand[newCmds.size()]));
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:JPFManifestBuilder.java

示例7: setBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
/**
 * Set the GW4E builder
 * 
 * @param project
 * @param monitor
 * @throws CoreException
 */
public static void setBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(GW4EBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:ClasspathManager.java

示例8: unsetBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
/**
 * Remove the GW4E builder
 * 
 * @param project
 * @param monitor
 * @throws CoreException
 */
public static void unsetBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
	IProjectDescription description = project.getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			GW4EBuilder.removeProjectProblemMarker(project, monitor);
			return;
		}
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:23,代码来源:ClasspathManager.java

示例9: addBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
public static void addBuilder(final IProject project) {
    try {
        // verify already registered builders
        if (hasBuilder(project)) {
            // already enabled
            return;
        }
        // add builder to project properties
        IProjectDescription description = project.getDescription();
        final ICommand buildCommand = description.newCommand();
        buildCommand.setBuilderName(BUILDER.ID);

        final List<ICommand> commands = new ArrayList<ICommand>();
        commands.addAll(Arrays.asList(description.getBuildSpec()));
        commands.add(buildCommand);

        description.setBuildSpec(commands.toArray(new ICommand[commands.size()]));
        project.setDescription(description, null);
    } catch (final CoreException e) {
        Log.log(Log.LOG_ERROR, "Cannot add builder", e); //$NON-NLS-1$
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:23,代码来源:AddBuilder.java

示例10: removeBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
public static void removeBuilder(final IProject project) {
    try {
        final IProjectDescription description = project
                .getDescription();
        final List<ICommand> commands = new ArrayList<ICommand>();
        commands.addAll(Arrays.asList(description.getBuildSpec()));

        for (final ICommand buildSpec : description.getBuildSpec()) {
            if (BUILDER.ID.equals(buildSpec.getBuilderName())) {
                // remove builder
                commands.remove(buildSpec);
            }
        }

        description.setBuildSpec(commands.toArray(new ICommand[commands.size()]));
        project.setDescription(description, null);
    } catch (final CoreException e) {
        Log.log(Log.LOG_ERROR, "Cannot remove builder", e); //$NON-NLS-1$
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:21,代码来源:RemoveBuilder.java

示例11: addBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
protected void addBuilder(String builderId) throws CoreException 
{
	IProjectDescription desc = _project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(builderId)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(builderId);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	_project.setDescription(desc, null);
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:20,代码来源:AbstractProjectNature.java

示例12: removeBuilder

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
protected void removeBuilder(String builderId) throws CoreException
{
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(builderId)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			_project.setDescription(description, null);			
			return;
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:17,代码来源:AbstractProjectNature.java

示例13: configure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(JimpleBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(JimpleBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:20,代码来源:VisuFlowNature.java

示例14: deconfigure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void deconfigure() throws CoreException {
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(JimpleBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			return;
		}
	}
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:17,代码来源:VisuFlowNature.java

示例15: configure

import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(ClassCleanerBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(ClassCleanerBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
开发者ID:CenterDevice,项目名称:ClassCleaner,代码行数:20,代码来源:ClassCleanerNature.java


注:本文中的org.eclipse.core.resources.IProjectDescription.setBuildSpec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。