當前位置: 首頁>>代碼示例>>Java>>正文


Java ICommand.setBuilding方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.ICommand.setBuilding方法的典型用法代碼示例。如果您正苦於以下問題:Java ICommand.setBuilding方法的具體用法?Java ICommand.setBuilding怎麽用?Java ICommand.setBuilding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.ICommand的用法示例。


在下文中一共展示了ICommand.setBuilding方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
@Override
public void configure() throws CoreException {
	// Setup the builder
	IProjectDescription desc = project.getDescription();
	ICommand[] builders = desc.getBuildSpec();
	ICommand[] newBuilders = new ICommand[builders.length + 1];
	System.arraycopy(builders, 0, newBuilders, 0, builders.length);

	ICommand androidBuilder = desc.newCommand();
	androidBuilder.setBuilderName(AndroidBuilder.ID);
	// We don't autobuild.
	androidBuilder.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
	newBuilders[builders.length] = androidBuilder;
	desc.setBuildSpec(newBuilders);

	project.setDescription(desc, 0, new NullProgressMonitor());
}
 
開發者ID:dschaefer,項目名稱:andmore2,代碼行數:18,代碼來源:AndroidNature.java

示例2: getBuildCommandsList

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
static ICommand[] getBuildCommandsList(IProjectDescription description,	ICommand[] commands) {
	ArrayList<ICommand> commandList = new ArrayList<ICommand>();

	// Make sure the CMake builder just precedes the Common Builder
	for (int i = 0; i < commands.length; i++) {
		ICommand command = commands[i];
		if (command.getBuilderName().equals(CMakeProjectBuilderImpl.BUILDER_ID)) {
			// ignore it
		} else {
			if (command.getBuilderName().equals(BUILDER_ID)) {
				// add CMake Configuration builder just before builder
				ICommand newCommand = description.newCommand();
				newCommand.setBuilderName(CMakeProjectBuilderImpl.BUILDER_ID);
				newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
				newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
				newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
				newCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
				commandList.add(newCommand);
			}
			commandList.add(command);
		}
	}
	return commandList.toArray(new ICommand[commandList.size()]);
}
 
開發者ID:rungemar,項目名稱:cmake4cdt,代碼行數:25,代碼來源:CMakeProjectNature.java

示例3: addToBuildSpec

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
/**
 * Adds a builder to the build spec for the configured project.
 */
protected void addToBuildSpec(String builderID) throws CoreException {
	IProjectDescription description = project.getDescription();
	ICommand[] commands = description.getBuildSpec();
	int commandIndex = getCommandIndex(commands, builderID);
	if (commandIndex == -1) {
		ICommand command = description.newCommand();
		command.setBuilderName(builderID);
		command.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
		
		// Add a build command to the build spec
		ICommand[] newCommands = ArrayUtil.prepend(command, commands);
		description.setBuildSpec(newCommands);
		project.setDescription(description, null);
	}
}
 
開發者ID:GoClipse,項目名稱:goclipse,代碼行數:19,代碼來源:LangNature.java

示例4: initProjectDescription

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
@Override
protected void initProjectDescription(IProjectDescription description) {
	description.setNatureIds(new String[] { JavaCore.NATURE_ID, AndroidNature.ID });

	ICommand javaBuilder = description.newCommand();
	javaBuilder.setBuilderName(JavaCore.BUILDER_ID);

	ICommand androidBuilder = description.newCommand();
	androidBuilder.setBuilderName(AndroidBuilder.ID);
	androidBuilder.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);

	description.setBuildSpec(new ICommand[] { javaBuilder, androidBuilder });
}
 
開發者ID:dschaefer,項目名稱:andmore2,代碼行數:14,代碼來源:AppProjectGenerator.java

示例5: disableAutoBuildMode

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
public static void disableAutoBuildMode(IProject project, String builderId, IProgressMonitor monitor) 
		throws CoreException {
	IProjectDescription description = project.getDescription();
	ICommand[] buildSpec = description.getBuildSpec();
	for(ICommand command : buildSpec) {
		if(command.getBuilderName().equals(builderId)) {
			command.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
		}
	}
	description.setBuildSpec(buildSpec);
	project.setDescription(description, IResource.AVOID_NATURE_CONFIG, monitor);
}
 
開發者ID:GoClipse,項目名稱:goclipse,代碼行數:13,代碼來源:LangNature.java

示例6: setupProject

import org.eclipse.core.resources.ICommand; //導入方法依賴的package包/類
/**
 * @param monitor
 */
public void setupProject(IProgressMonitor monitor) throws CoreException {
	// Add CMake nature
	IProjectDescription projDesc = project.getDescription();
	boolean cmakeNatureAlreadyThere = false;
	String[] oldIds = projDesc.getNatureIds();

	for(int i=0; i < oldIds.length; i++) {
		if(oldIds[i].equals(CMakeProjectNature.CMAKE_NATURE_ID)) {
			cmakeNatureAlreadyThere = true;
		}
	}
	if(!cmakeNatureAlreadyThere) {
		String[] newIds = new String[oldIds.length + 1];
		System.arraycopy(oldIds, 0, newIds, 0, oldIds.length);
		newIds[newIds.length - 1] = CMakeProjectNature.CMAKE_NATURE_ID;
		projDesc.setNatureIds(newIds);
		project.setDescription(projDesc, monitor);
	}

	// create the CDT natures and build setup
	CCorePlugin.getDefault().createCDTProject(projDesc, project, monitor);
	CCorePlugin.getDefault().convertProjectFromCtoCC(project, monitor);
	
	ICProjectDescription cprojDesc = CCorePlugin.getDefault().createProjectDescription(project, false);
	ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
	ManagedProject mProj = new ManagedProject(cprojDesc);
	info.setManagedProject(mProj);

	createBuildConfigurations(cprojDesc);

	// Add CMake builder
	projDesc = project.getDescription();
	ICommand[] oldBuilders = projDesc.getBuildSpec();

	boolean genMakeBilderAlreadyThere = false;
	boolean cmakeBuilderAlreadyThere = false;
	int additionalBuilders = 2;
	for(int i=0; i < oldBuilders.length; i++) {
		if(oldBuilders[i].getBuilderName().equals(CMAKE_BUILDER_ID)) {
			cmakeBuilderAlreadyThere = true;
			additionalBuilders--;
		}
		if(oldBuilders[i].getBuilderName().equals(GEN_MAKE_BUILDER_ID)) {
			genMakeBilderAlreadyThere = true;
			additionalBuilders--;
		}
	}
	if(additionalBuilders < 0) {
		additionalBuilders = 0;
	}

	ICommand[] newBuilders = new ICommand[oldBuilders.length + additionalBuilders];
	
	if(!cmakeBuilderAlreadyThere) {
		ICommand cmakeBuilder = projDesc.newCommand();
		cmakeBuilder.setBuilderName(CMAKE_BUILDER_ID);
		cmakeBuilder.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
		cmakeBuilder.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
		cmakeBuilder.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
		newBuilders[0] = cmakeBuilder;
	}
	
	if(!genMakeBilderAlreadyThere) {
		ICommand makeBuilder = projDesc.newCommand();
		makeBuilder.setBuilderName(GEN_MAKE_BUILDER_ID);
		makeBuilder.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
		makeBuilder.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
		makeBuilder.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
		newBuilders[1] = makeBuilder;
	}		
	System.arraycopy(oldBuilders, 0, newBuilders, additionalBuilders, oldBuilders.length);
	
	projDesc.setBuildSpec(newBuilders);
	project.setDescription(projDesc, monitor);		

	CCorePlugin.getDefault().setProjectDescription(project, cprojDesc, true, monitor);
}
 
開發者ID:rungemar,項目名稱:cmake4cdt,代碼行數:81,代碼來源:CMakeProjectGenerator.java


注:本文中的org.eclipse.core.resources.ICommand.setBuilding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。