mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bugs #216017, 216018: MultiConfigurations bug fix
This commit is contained in:
parent
68d6fce0c3
commit
fb314ecfd8
12 changed files with 611 additions and 206 deletions
|
@ -57,6 +57,7 @@ import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
|
|||
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
|
@ -81,6 +82,8 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineGenerator;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Option;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.OptionCategory;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.OutputType;
|
||||
|
@ -3892,6 +3895,13 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
private static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes, boolean checkConsistance){
|
||||
if(cfgDes == null)
|
||||
return null;
|
||||
|
||||
if (cfgDes instanceof ICMultiConfigDescription) {
|
||||
ICMultiConfigDescription mcd = (ICMultiConfigDescription)cfgDes;
|
||||
ICConfigurationDescription[] cfds = (ICConfigurationDescription[])mcd.getItems();
|
||||
return new MultiConfiguration(cfds, mcd.getStringListMode());
|
||||
}
|
||||
|
||||
CConfigurationData cfgData = cfgDes.getConfigurationData();
|
||||
if(cfgData instanceof BuildConfigurationData){
|
||||
IConfiguration cfg = ((BuildConfigurationData)cfgData).getConfiguration();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -10,9 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
|
||||
import org.eclipse.cdt.core.settings.model.MultiItemsHolder;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CBuildData;
|
||||
|
@ -35,6 +37,7 @@ import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
|||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
|
||||
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
|
@ -44,8 +47,8 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* This class represents a set of configurations
|
||||
* to be edited simultaneously on property pages.
|
||||
*/
|
||||
public class MultiConfiguration extends MultiItemsHolder implements
|
||||
IMultiConfiguration {
|
||||
|
@ -58,6 +61,18 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
setStringListMode(mode);
|
||||
}
|
||||
|
||||
public MultiConfiguration(ICConfigurationDescription[] cfds, int mode) {
|
||||
this(cfds2cfs(cfds),mode);
|
||||
}
|
||||
|
||||
public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) {
|
||||
IConfiguration[] cfs = new IConfiguration[cfgds.length];
|
||||
for (int i=0; i<cfgds.length; i++)
|
||||
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]);
|
||||
return cfs;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems()
|
||||
*/
|
||||
|
@ -76,7 +91,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#calculateTargetTool()
|
||||
*/
|
||||
public ITool calculateTargetTool() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.calculateTargetTool()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.calculateTargetTool()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -92,7 +107,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath)
|
||||
*/
|
||||
public IFileInfo createFileInfo(IPath path) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(1)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(1)"); //$NON-NLS-1$
|
||||
return null; // curr().createFileInfo(path);
|
||||
}
|
||||
|
||||
|
@ -100,7 +115,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
||||
*/
|
||||
public IFileInfo createFileInfo(IPath path, String id, String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(3)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(3)"); //$NON-NLS-1$
|
||||
return null; // curr().createFileInfo(path, id, name);
|
||||
}
|
||||
|
||||
|
@ -109,7 +124,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
public IFileInfo createFileInfo(IPath path, IFolderInfo base,
|
||||
ITool baseTool, String id, String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(5)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(5)"); //$NON-NLS-1$
|
||||
return null; // curr().createFileInfo(path, base, baseTool, id, name);
|
||||
}
|
||||
|
||||
|
@ -118,7 +133,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id,
|
||||
String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(4)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(4)"); //$NON-NLS-1$
|
||||
return null; // curr().createFileInfo(path, base, id, name);
|
||||
}
|
||||
|
||||
|
@ -126,7 +141,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath)
|
||||
*/
|
||||
public IFolderInfo createFolderInfo(IPath path) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -134,7 +149,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
||||
*/
|
||||
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(3)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(3)"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -143,7 +158,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base,
|
||||
String id, String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(4)");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(4)"); //$NON-NLS-1$
|
||||
return null; // do nothing now
|
||||
}
|
||||
|
||||
|
@ -151,7 +166,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createResourceConfiguration(org.eclipse.core.resources.IFile)
|
||||
*/
|
||||
public IResourceConfiguration createResourceConfiguration(IFile file) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createResourceConfiguration()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createResourceConfiguration()"); //$NON-NLS-1$
|
||||
return null; // do nothing now
|
||||
}
|
||||
|
||||
|
@ -160,7 +175,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
*/
|
||||
public IToolChain createToolChain(IToolChain superClass, String Id,
|
||||
String name, boolean isExtensionElement) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.createToolChain()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.createToolChain()"); //$NON-NLS-1$
|
||||
return null; // do nothing
|
||||
}
|
||||
|
||||
|
@ -171,7 +186,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
String sourceExtension, String[] flags, String outputFlag,
|
||||
String outputPrefix, String outputName, String[] inputResources,
|
||||
IPath inputLocation, IPath outputLocation) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.generateToolCommandLineInfo()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -251,7 +266,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildData()
|
||||
*/
|
||||
public CBuildData getBuildData() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBuildData()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBuildData()"); //$NON-NLS-1$
|
||||
return curr().getBuildData();
|
||||
}
|
||||
|
||||
|
@ -296,7 +311,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getConfigurationData()
|
||||
*/
|
||||
public CConfigurationData getConfigurationData() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getConfigurationData()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getConfigurationData()"); //$NON-NLS-1$
|
||||
return curr().getConfigurationData();
|
||||
}
|
||||
|
||||
|
@ -315,7 +330,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEditableBuilder()
|
||||
*/
|
||||
public IBuilder getEditableBuilder() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getEditableBuilder()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getEditableBuilder()"); //$NON-NLS-1$
|
||||
return curr().getEditableBuilder();
|
||||
}
|
||||
|
||||
|
@ -363,7 +378,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
||||
*/
|
||||
public ITool[] getFilteredTools() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getFilteredTools()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getFilteredTools()"); //$NON-NLS-1$
|
||||
return new ITool[0];
|
||||
}
|
||||
|
||||
|
@ -449,7 +464,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getParent()
|
||||
*/
|
||||
public IConfiguration getParent() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getParent()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getParent()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -509,7 +524,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getProjectType()
|
||||
*/
|
||||
public IProjectType getProjectType() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getProjectType()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getProjectType()"); //$NON-NLS-1$
|
||||
return curr().getProjectType();
|
||||
}
|
||||
|
||||
|
@ -517,7 +532,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfiguration(java.lang.String)
|
||||
*/
|
||||
public IResourceConfiguration getResourceConfiguration(String path) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfiguration()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfiguration()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -525,7 +540,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfigurations()
|
||||
*/
|
||||
public IResourceConfiguration[] getResourceConfigurations() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfigurations()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfigurations()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -533,15 +548,17 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfo(org.eclipse.core.runtime.IPath, boolean)
|
||||
*/
|
||||
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceInfo()");
|
||||
return null;
|
||||
IResourceInfo ris[] = new IResourceInfo[fCfgs.length];
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
ris[i] = fCfgs[i].getResourceInfo(path, exactPath);
|
||||
return new MultiResourceInfo(ris);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfoById(java.lang.String)
|
||||
*/
|
||||
public IResourceInfo getResourceInfoById(String id) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceInfoById()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceInfoById()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -549,23 +566,29 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfos()
|
||||
*/
|
||||
public IResourceInfo[] getResourceInfos() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getResourceInfos()");
|
||||
return null; // curr().getResourceInfos();
|
||||
ArrayList ri = new ArrayList();
|
||||
for (int i=0; i<fCfgs.length; i++) {
|
||||
IResourceInfo[] ris = fCfgs[i].getResourceInfos();
|
||||
ri.addAll(Arrays.asList(ris));
|
||||
}
|
||||
return (IResourceInfo[])ri.toArray(new IResourceInfo[ri.size()]);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getRootFolderInfo()
|
||||
*/
|
||||
public IFolderInfo getRootFolderInfo() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getRootFolderInfo()");
|
||||
return curr().getRootFolderInfo();
|
||||
IFolderInfo ris[] = new IFolderInfo[fCfgs.length];
|
||||
for (int i=0; i<fCfgs.length; i++)
|
||||
ris[i] = fCfgs[i].getRootFolderInfo();
|
||||
return new MultiFolderInfo(ris);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getSourceEntries()
|
||||
*/
|
||||
public ICSourceEntry[] getSourceEntries() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getSourceEntries()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getSourceEntries()"); //$NON-NLS-1$
|
||||
return new ICSourceEntry[0];
|
||||
}
|
||||
|
||||
|
@ -573,7 +596,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
||||
*/
|
||||
public ITool getTargetTool() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTargetTool()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTargetTool()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -581,7 +604,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTool(java.lang.String)
|
||||
*/
|
||||
public ITool getTool(String id) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTool()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTool()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -589,7 +612,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolChain()
|
||||
*/
|
||||
public IToolChain getToolChain() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolChain()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolChain()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -597,7 +620,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolCommand(org.eclipse.cdt.managedbuilder.core.ITool)
|
||||
*/
|
||||
public String getToolCommand(ITool tool) {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getToolCommand()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getToolCommand()"); //$NON-NLS-1$
|
||||
return EMPTY_STR;
|
||||
}
|
||||
|
||||
|
@ -605,7 +628,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromInputExtension(java.lang.String)
|
||||
*/
|
||||
public ITool getToolFromInputExtension(String sourceExtension) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolFromInputExtension()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolFromInputExtension()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -613,7 +636,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromOutputExtension(java.lang.String)
|
||||
*/
|
||||
public ITool getToolFromOutputExtension(String extension) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolFromOutputExtension()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolFromOutputExtension()"); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -621,7 +644,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTools()
|
||||
*/
|
||||
public ITool[] getTools() {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTools()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getTools()"); //$NON-NLS-1$
|
||||
return new ITool[0];
|
||||
}
|
||||
|
||||
|
@ -629,7 +652,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
|
||||
*/
|
||||
public ITool[] getToolsBySuperClassId(String id) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolsBySuperClassId()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.getToolsBySuperClassId()"); //$NON-NLS-1$
|
||||
return new ITool[0];
|
||||
}
|
||||
|
||||
|
@ -637,7 +660,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getUserObjects(java.lang.String)
|
||||
*/
|
||||
public String[] getUserObjects(String extension) {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getUserObjects()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getUserObjects()"); //$NON-NLS-1$
|
||||
return EMPTY_STR_ARRAY;
|
||||
}
|
||||
|
||||
|
@ -675,7 +698,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
|
||||
*/
|
||||
public boolean isExtensionElement() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.isExtensionElement()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.isExtensionElement()"); //$NON-NLS-1$
|
||||
return curr().isExtensionElement();
|
||||
}
|
||||
|
||||
|
@ -683,7 +706,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
|
||||
*/
|
||||
public boolean isHeaderFile(String ext) {
|
||||
System.out.println("Strange multi access: MultiConfiguration.isHeaderFile()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.isHeaderFile()"); //$NON-NLS-1$
|
||||
return curr().isHeaderFile(ext);
|
||||
}
|
||||
|
||||
|
@ -862,7 +885,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
|
||||
*/
|
||||
public void setName(String name) {
|
||||
System.out.println("Bad multi access: MultiConfiguration.setName()");
|
||||
System.out.println("Bad multi access: MultiConfiguration.setName()"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -968,7 +991,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
|
||||
*/
|
||||
public String getBaseId() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBaseId()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBaseId()"); //$NON-NLS-1$
|
||||
return curr().getBaseId();
|
||||
}
|
||||
|
||||
|
@ -976,14 +999,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
|
||||
*/
|
||||
public String getId() {
|
||||
return curr().getId() + "_etc";
|
||||
return curr().getId() + "_etc"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
|
||||
*/
|
||||
public String getManagedBuildRevision() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getMngBuildRevision()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getMngBuildRevision()"); //$NON-NLS-1$
|
||||
return curr().getManagedBuildRevision();
|
||||
}
|
||||
|
||||
|
@ -991,14 +1014,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return "Multiple configurations";
|
||||
return "Multiple configurations"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
|
||||
*/
|
||||
public PluginVersionIdentifier getVersion() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getVersion()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getVersion()"); //$NON-NLS-1$
|
||||
return curr().getVersion();
|
||||
}
|
||||
|
||||
|
@ -1006,14 +1029,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
|
||||
*/
|
||||
public void setVersion(PluginVersionIdentifier version) {
|
||||
System.out.println("Strange multi access: MultiConfiguration.setVersion()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.setVersion()"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObjectPropertiesContainer#getBuildProperties()
|
||||
*/
|
||||
public IBuildObjectProperties getBuildProperties() {
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBuildProperties()");
|
||||
System.out.println("Strange multi access: MultiConfiguration.getBuildProperties()"); //$NON-NLS-1$
|
||||
return curr().getBuildProperties();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.extension.CFolderData;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IModificationStatus;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
|
||||
/**
|
||||
* This class holds a number of IFolderInfo objects
|
||||
* delonging to different configurations when they
|
||||
* are edited simultaneously.
|
||||
*/
|
||||
public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
|
||||
|
||||
public MultiFolderInfo(IFolderInfo[] ris) {
|
||||
super(ris);
|
||||
fRis = ris;
|
||||
}
|
||||
|
||||
public boolean buildsFileType(String srcExt) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (! ((IFolderInfo)fRis[i]).buildsFileType(srcExt))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public IToolChain changeToolChain(IToolChain newSuperClass, String Id,
|
||||
String name) throws BuildException {
|
||||
IToolChain t = null;
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
t = ((IFolderInfo)fRis[i]).changeToolChain(newSuperClass, Id, name);
|
||||
return t;
|
||||
}
|
||||
|
||||
public ITool[] getFilteredTools() {
|
||||
return ((IFolderInfo)fRis[0]).getFilteredTools();
|
||||
}
|
||||
|
||||
public CFolderData getFolderData() {
|
||||
return ((IFolderInfo)fRis[0]).getFolderData();
|
||||
}
|
||||
|
||||
public String getOutputExtension(String resourceExtension) {
|
||||
return ((IFolderInfo)fRis[0]).getOutputExtension(resourceExtension);
|
||||
}
|
||||
|
||||
public ITool getTool(String id) {
|
||||
return ((IFolderInfo)fRis[0]).getTool(id);
|
||||
}
|
||||
|
||||
public IToolChain getToolChain() {
|
||||
return ((IFolderInfo)fRis[0]).getToolChain();
|
||||
}
|
||||
|
||||
public IModificationStatus getToolChainModificationStatus(ITool[] removed,
|
||||
ITool[] added) {
|
||||
return ((IFolderInfo)fRis[0]).getToolChainModificationStatus(removed, added);
|
||||
}
|
||||
|
||||
public ITool getToolFromInputExtension(String sourceExtension) {
|
||||
return ((IFolderInfo)fRis[0]).getToolFromInputExtension(sourceExtension);
|
||||
}
|
||||
|
||||
public ITool getToolFromOutputExtension(String extension) {
|
||||
return ((IFolderInfo)fRis[0]).getToolFromOutputExtension(extension);
|
||||
}
|
||||
|
||||
public ITool[] getToolsBySuperClassId(String id) {
|
||||
return ((IFolderInfo)fRis[0]).getToolsBySuperClassId(id);
|
||||
}
|
||||
|
||||
public boolean isHeaderFile(String ext) {
|
||||
return ((IFolderInfo)fRis[0]).isHeaderFile(ext);
|
||||
}
|
||||
|
||||
public boolean isToolChainCompatible(IToolChain ch) {
|
||||
return ((IFolderInfo)fRis[0]).isToolChainCompatible(ch);
|
||||
}
|
||||
|
||||
public void modifyToolChain(ITool[] removed, ITool[] added)
|
||||
throws BuildException {
|
||||
((IFolderInfo)fRis[0]).modifyToolChain(removed, added);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,352 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.MultiItemsHolder;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CLanguageData;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CResourceData;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.OptionStringValue;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||
|
||||
/**
|
||||
* This class holds a number of IResourceInfo objects
|
||||
* belonging to different configurations while they are
|
||||
* edited simultaneously.
|
||||
*/
|
||||
public class MultiResourceInfo extends MultiItemsHolder implements
|
||||
IResourceInfo {
|
||||
private static final int MODE_BOOL = 0;
|
||||
private static final int MODE_STR = 1;
|
||||
private static final int MODE_SAR = 2;
|
||||
private static final int MODE_OSV = 3;
|
||||
private static final int MODE_CMDLINE = 4;
|
||||
private static final int MODE_COMMAND = 5;
|
||||
|
||||
protected IResourceInfo[] fRis = null;
|
||||
|
||||
public MultiResourceInfo(IResourceInfo[] ris) {
|
||||
fRis = ris;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#canExclude(boolean)
|
||||
*/
|
||||
public boolean canExclude(boolean exclude) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (! fRis[i].canExclude(exclude))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getCLanguageDatas()
|
||||
*/
|
||||
public CLanguageData[] getCLanguageDatas() {
|
||||
return fRis[0].getCLanguageDatas();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getKind()
|
||||
*/
|
||||
public int getKind() {
|
||||
return fRis[0].getKind();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getParent()
|
||||
*/
|
||||
public IConfiguration getParent() {
|
||||
return fRis[0].getParent();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getPath()
|
||||
*/
|
||||
public IPath getPath() {
|
||||
return fRis[0].getPath();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getResourceData()
|
||||
*/
|
||||
public CResourceData getResourceData() {
|
||||
System.out.println("Strange call: MultiResourceInfo.getResourceData()"); //$NON-NLS-1$
|
||||
return fRis[0].getResourceData();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getTools()
|
||||
*/
|
||||
public ITool[] getTools() {
|
||||
System.out.println("Strange call: MultiResourceInfo.getTools()"); //$NON-NLS-1$
|
||||
return fRis[0].getTools();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isDirty()
|
||||
*/
|
||||
public boolean isDirty() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (fRis[i].isDirty())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isExcluded()
|
||||
*/
|
||||
public boolean isExcluded() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (fRis[i].isExcluded())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isExtensionElement()
|
||||
*/
|
||||
public boolean isExtensionElement() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (fRis[i].isExtensionElement())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isSupported()
|
||||
*/
|
||||
public boolean isSupported() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (fRis[i].isSupported())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isValid()
|
||||
*/
|
||||
public boolean isValid() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (!fRis[i].isValid())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#needsRebuild()
|
||||
*/
|
||||
public boolean needsRebuild() {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
if (fRis[i].needsRebuild())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setDirty(boolean)
|
||||
*/
|
||||
public void setDirty(boolean dirty) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
fRis[i].setDirty(dirty);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setExclude(boolean)
|
||||
*/
|
||||
public void setExclude(boolean excluded) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
fRis[i].setExclude(excluded);
|
||||
}
|
||||
|
||||
private String getSuperClassId(IOption op) {
|
||||
String s = null;
|
||||
while (op != null){
|
||||
s = op.getId();
|
||||
op = op.getSuperClass();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public void setToolsCommand(ITool tool, String s) {
|
||||
setTool(tool, s, MODE_COMMAND);
|
||||
}
|
||||
|
||||
public void setCommandLinePattern(ITool tool, String s) {
|
||||
setTool(tool, s, MODE_CMDLINE);
|
||||
}
|
||||
|
||||
private void setTool(ITool tool, String s, int mode) {
|
||||
String ext = tool.getDefaultInputExtension();
|
||||
for (int i=0; i<fRis.length; i++) {
|
||||
ITool[] ts = fRis[i].getTools();
|
||||
for (int j=0; j<ts.length; j++) {
|
||||
if (ext != null &&
|
||||
! ext.equals(ts[j].getDefaultInputExtension()))
|
||||
continue;
|
||||
switch (mode) {
|
||||
case MODE_COMMAND:
|
||||
ts[j].setToolCommand(s);
|
||||
break;
|
||||
case MODE_CMDLINE:
|
||||
ts[j].setCommandLinePattern(s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IOption setOption(IHoldsOptions parent, IOption option, Object value, int mode)
|
||||
throws BuildException {
|
||||
IOption op = null;
|
||||
String ext = parent instanceof ITool ? ((ITool)parent).getDefaultInputExtension() : null;
|
||||
String sid = getSuperClassId(option);
|
||||
for (int i=0; i<fRis.length; i++) {
|
||||
ITool[] ts = fRis[i].getTools();
|
||||
for (int j=0; j<ts.length; j++) {
|
||||
if (ext != null &&
|
||||
! ext.equals(ts[j].getDefaultInputExtension()))
|
||||
continue;
|
||||
IOption op2 = ts[j].getOptionBySuperClassId(sid);
|
||||
if (op2 != null) {
|
||||
switch (mode) {
|
||||
case MODE_BOOL:
|
||||
op = fRis[i].setOption(ts[j], op2, ((Boolean)value).booleanValue());
|
||||
break;
|
||||
case MODE_STR:
|
||||
op = fRis[i].setOption(ts[j], op2, (String)value);
|
||||
break;
|
||||
case MODE_SAR:
|
||||
op = fRis[i].setOption(ts[j], op2, (String[])value);
|
||||
break;
|
||||
case MODE_OSV:
|
||||
op = fRis[i].setOption(ts[j], op2, (OptionStringValue[])value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||
throws BuildException {
|
||||
return setOption(parent, option, new Boolean(value), MODE_BOOL);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String)
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, String value)
|
||||
throws BuildException {
|
||||
return setOption(parent, option, value, MODE_STR);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String[])
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option,
|
||||
String[] value) throws BuildException {
|
||||
return setOption(parent, option, value, MODE_SAR);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, org.eclipse.cdt.managedbuilder.core.OptionStringValue[])
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option,
|
||||
OptionStringValue[] value) throws BuildException {
|
||||
return setOption(parent, option, value, MODE_OSV);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setPath(org.eclipse.core.runtime.IPath)
|
||||
*/
|
||||
public void setPath(IPath path) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
fRis[i].setPath(path);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setRebuildState(boolean)
|
||||
*/
|
||||
public void setRebuildState(boolean rebuild) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
fRis[i].setRebuildState(rebuild);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#supportsBuild(boolean)
|
||||
*/
|
||||
public boolean supportsBuild(boolean managed) {
|
||||
return fRis[0].supportsBuild(managed);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
|
||||
*/
|
||||
public String getBaseId() {
|
||||
return fRis[0].getBaseId();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
|
||||
*/
|
||||
public String getId() {
|
||||
return fRis[0].getId();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
|
||||
*/
|
||||
public String getManagedBuildRevision() {
|
||||
return fRis[0].getManagedBuildRevision();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return fRis[0].getName();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
|
||||
*/
|
||||
public PluginVersionIdentifier getVersion() {
|
||||
return fRis[0].getVersion();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
|
||||
*/
|
||||
public void setVersion(PluginVersionIdentifier version) {
|
||||
for (int i=0; i<fRis.length; i++)
|
||||
fRis[i].setVersion(version);
|
||||
}
|
||||
|
||||
public Object[] getItems() {
|
||||
return fRis;
|
||||
}
|
||||
|
||||
public boolean isRoot() {
|
||||
return ((ResourceInfo)fRis[0]).isRoot();
|
||||
}
|
||||
|
||||
}
|
|
@ -263,7 +263,12 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
|
|||
public Object[][] getOptions(IResourceInfo resinfo, IHoldsOptions optionHolder) {
|
||||
IHoldsOptions[] optionHolders = new IHoldsOptions[1];
|
||||
optionHolders[0] = optionHolder;
|
||||
return getOptions(optionHolders, ((ResourceInfo)resinfo).isRoot() ? FILTER_PROJECT : FILTER_FILE);
|
||||
boolean isRoot = false;
|
||||
if (resinfo instanceof ResourceInfo)
|
||||
isRoot = ((ResourceInfo)resinfo).isRoot();
|
||||
else if (resinfo instanceof MultiResourceInfo)
|
||||
isRoot = ((MultiResourceInfo)resinfo).isRoot();
|
||||
return getOptions(optionHolders, isRoot ? FILTER_PROJECT : FILTER_FILE);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -49,10 +49,7 @@ public abstract class AbstractCBuildPropertyTab extends AbstractCPropertyTab {
|
|||
public IConfiguration getCfg(ICConfigurationDescription cfgd) {
|
||||
if (cfgd instanceof ICMultiConfigDescription) {
|
||||
ICConfigurationDescription[] cfds = (ICConfigurationDescription[])((ICMultiConfigDescription)cfgd).getItems();
|
||||
IConfiguration[] cfs = new IConfiguration[cfds.length];
|
||||
for (int i=0; i<cfds.length; i++)
|
||||
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfds[i]);
|
||||
return new MultiConfiguration(cfs, 9);
|
||||
return new MultiConfiguration(cfds, 9);
|
||||
} else
|
||||
return ManagedBuildManager.getConfigurationForDescription(cfgd);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.managedbuilder.core.BuildException;
|
|||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiResourceInfo;
|
||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||
import org.eclipse.cdt.ui.newui.MultiLineTextFieldEditor;
|
||||
import org.eclipse.cdt.ui.newui.UIMessages;
|
||||
|
@ -472,118 +473,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
|||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
|
||||
*/
|
||||
public boolean performOk() {
|
||||
// Do the super-class thang
|
||||
boolean result = super.performOk();
|
||||
/*
|
||||
//parse and store all build options in the corresponding preference store
|
||||
//parseAllOptions();
|
||||
|
||||
// Write the preference store values back to the build model
|
||||
IOptionCategory clonedCategory = (IOptionCategory)fTool;
|
||||
Object[][] clonedOptions;
|
||||
clonedOptions = clonedCategory.getOptions(cfg, clonedTool);
|
||||
|
||||
if ( clonedOptions == null)
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < clonedOptions.length; i++) {
|
||||
ITool clonedTool = (ITool)clonedOptions[i][0];
|
||||
if (clonedTool == null) break; // The array may not be full
|
||||
IOption clonedOption = (IOption)clonedOptions[i][1];
|
||||
|
||||
try {
|
||||
// Transfer value from preference store to options
|
||||
IOption setOption = null;
|
||||
switch (clonedOption.getValueType()) {
|
||||
case IOption.BOOLEAN :
|
||||
boolean boolVal = clonedOption.getBooleanValue();;
|
||||
// setOption = ManagedBuildManager.setOption(realCfg, realTool, realOption, boolVal);
|
||||
// Reset the preference store since the Id may have changed
|
||||
// if (setOption != option) {
|
||||
// getToolSettingsPrefStore().setValue(setOption.getId(), boolVal);
|
||||
// }
|
||||
break;
|
||||
case IOption.ENUMERATED :
|
||||
String enumVal = clonedOption.getStringValue();
|
||||
String enumId = clonedOption.getEnumeratedId(enumVal);
|
||||
// setOption = ManagedBuildManager.setOption(realCfg, realTool, realOption,
|
||||
// (enumId != null && enumId.length() > 0) ? enumId : enumVal);
|
||||
// Reset the preference store since the Id may have changed
|
||||
// if (setOption != option) {
|
||||
// getToolSettingsPrefStore().setValue(setOption.getId(), enumVal);
|
||||
// }
|
||||
break;
|
||||
case IOption.STRING :
|
||||
String strVal = clonedOption.getStringValue();
|
||||
// setOption = ManagedBuildManager.setOption(realCfg, realTool, realOption, strVal);
|
||||
// Reset the preference store since the Id may have changed
|
||||
// if (setOption != option) {
|
||||
// getToolSettingsPrefStore().setValue(setOption.getId(), strVal);
|
||||
// }
|
||||
break;
|
||||
case IOption.STRING_LIST :
|
||||
case IOption.INCLUDE_PATH :
|
||||
case IOption.PREPROCESSOR_SYMBOLS :
|
||||
case IOption.LIBRARIES :
|
||||
case IOption.OBJECTS :
|
||||
// String listStr = getToolSettingsPreferenceStore().getString(option.getId());
|
||||
String[] listVal = (String[])((List)clonedOption.getValue()).toArray(new String[0]);
|
||||
// setOption = ManagedBuildManager.setOption(realCfg, realTool, realOption, listVal);
|
||||
// Reset the preference store since the Id may have changed
|
||||
// if (setOption != option) {
|
||||
// getToolSettingsPreferenceStore().setValue(setOption.getId(), listStr);
|
||||
// }
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
// Call an MBS CallBack function to inform that Settings related to Apply/OK button
|
||||
// press have been applied.
|
||||
if (setOption == null)
|
||||
setOption = realOption;
|
||||
//
|
||||
// if (setOption.getValueHandler().handleValue(
|
||||
// handler,
|
||||
// setOption.getOptionHolder(),
|
||||
// setOption,
|
||||
// setOption.getValueHandlerExtraArgument(),
|
||||
// IManagedOptionValueHandler.EVENT_APPLY)) {
|
||||
// // TODO : Event is handled successfully and returned true.
|
||||
// // May need to do something here say log a message.
|
||||
// } else {
|
||||
// // Event handling Failed.
|
||||
// }
|
||||
|
||||
} catch (BuildException e) {
|
||||
} catch (ClassCastException e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Save the tool command if it has changed
|
||||
// Get the actual value out of the field editor
|
||||
String command = clonedTool.getToolCommand();
|
||||
if (command.length() > 0 &&
|
||||
(!command.equals(tool.getToolCommand()))) {
|
||||
|
||||
// if ( isItResourceConfigPage ) {
|
||||
// ManagedBuildManager.setToolCommand(realRcCfg, tool, command);
|
||||
// } else {
|
||||
// ManagedBuildManager.setToolCommand(realCfg, tool, command);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// Save the tool command line pattern if it has changed
|
||||
// Get the actual value out of the field editor
|
||||
String commandLinePattern = clonedTool.getCommandLinePattern();
|
||||
if (commandLinePattern.length() > 0 &&
|
||||
(!commandLinePattern.equals(tool.getCommandLinePattern()))) {
|
||||
tool.setCommandLinePattern(commandLinePattern);
|
||||
}
|
||||
*/
|
||||
|
||||
return result;
|
||||
return super.performOk();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -603,12 +493,23 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
|||
// allow superclass to handle as well
|
||||
super.propertyChange(event);
|
||||
|
||||
if(event.getSource() == commandStringField){
|
||||
fTool.setToolCommand(commandStringField.getStringValue());
|
||||
updateFields();
|
||||
}
|
||||
else if(event.getSource() == commandLinePatternField){
|
||||
fTool.setCommandLinePattern(commandLinePatternField.getStringValue());
|
||||
if (fInfo instanceof MultiResourceInfo) {
|
||||
MultiResourceInfo mri = (MultiResourceInfo)fInfo;
|
||||
if(event.getSource() == commandStringField){
|
||||
mri.setToolsCommand(fTool, commandStringField.getStringValue());
|
||||
updateFields();
|
||||
}
|
||||
else if(event.getSource() == commandLinePatternField){
|
||||
mri.setCommandLinePattern(fTool, commandLinePatternField.getStringValue());
|
||||
}
|
||||
} else {
|
||||
if(event.getSource() == commandStringField){
|
||||
fTool.setToolCommand(commandStringField.getStringValue());
|
||||
updateFields();
|
||||
}
|
||||
else if(event.getSource() == commandLinePatternField){
|
||||
fTool.setCommandLinePattern(commandLinePatternField.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -28,6 +28,7 @@ import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
|||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
||||
import org.eclipse.cdt.ui.newui.AbstractPage;
|
||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
||||
|
@ -592,14 +593,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
|
||||
public void updateData(ICResourceDescription cfgd) {
|
||||
if (page.isMultiCfg()) {
|
||||
usercomp.setVisible(false);
|
||||
} else {
|
||||
usercomp.setVisible(true);
|
||||
fInfo = getResCfg(cfgd);
|
||||
setValues();
|
||||
handleOptionSelection();
|
||||
}
|
||||
}
|
||||
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
|
@ -626,8 +622,10 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
public void updateTitle() {}
|
||||
|
||||
public boolean canBeVisible() {
|
||||
if (page.isMultiCfg())
|
||||
return false;
|
||||
return getCfg().getBuilder().isManagedBuildOn();
|
||||
IConfiguration cfg = getCfg();
|
||||
if (cfg instanceof MultiConfiguration)
|
||||
return ((MultiConfiguration)cfg).isManagedBuildOn();
|
||||
else
|
||||
return cfg.getBuilder().isManagedBuildOn();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -52,7 +52,7 @@ public class MultiResourceDescription extends MultiItemsHolder implements ICMult
|
|||
* @see org.eclipse.cdt.core.settings.model.ICResourceDescription#getParentFolderDescription()
|
||||
*/
|
||||
public ICFolderDescription getParentFolderDescription() {
|
||||
System.out.println("Bad multi access: MultiResourceDescription.getParentFolderDescription()");
|
||||
System.out.println("Bad multi access: MultiResourceDescription.getParentFolderDescription()"); //$NON-NLS-1$
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,13 @@ public class MultiResourceDescription extends MultiItemsHolder implements ICMult
|
|||
* @see org.eclipse.cdt.core.settings.model.ICResourceDescription#getPath()
|
||||
*/
|
||||
public IPath getPath() {
|
||||
System.out.println("Bad multi access: MultiResourceDescription.getPath()");
|
||||
IPath p = fRess[0].getPath();
|
||||
if (p != null) {
|
||||
for (int i=1; i<fRess.length; i++)
|
||||
if (!p.equals(fRess[i].getPath()))
|
||||
throw new UnsupportedOperationException();
|
||||
return p;
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
@ -94,7 +100,7 @@ public class MultiResourceDescription extends MultiItemsHolder implements ICMult
|
|||
* @see org.eclipse.cdt.core.settings.model.ICSettingContainer#getChildSettings()
|
||||
*/
|
||||
public ICSettingObject[] getChildSettings() {
|
||||
System.out.println("Bad multi access: MultiResourceDescription.getChildSettings()");
|
||||
System.out.println("Bad multi access: MultiResourceDescription.getChildSettings()"); //$NON-NLS-1$
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
@ -117,14 +123,14 @@ public class MultiResourceDescription extends MultiItemsHolder implements ICMult
|
|||
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getId()
|
||||
*/
|
||||
public String getId() {
|
||||
return fRess[0].getId() + "_etc";
|
||||
return fRess[0].getId() + "_etc"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return "Multiple Resource Description";
|
||||
return "Multiple Resource Description"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -184,6 +190,7 @@ public class MultiResourceDescription extends MultiItemsHolder implements ICMult
|
|||
return fRess;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setSettingEntries(ICLanguageSetting lang, int kind, List incs, boolean toAll) {
|
||||
for (int i=0; i<fRess.length; i++) {
|
||||
if (fRess[i] instanceof ICFolderDescription) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -113,6 +113,7 @@ implements
|
|||
private static ICResourceDescription resd = null;
|
||||
private static ICConfigurationDescription[] cfgDescs = null;
|
||||
private static int cfgIndex = -1;
|
||||
private static ICConfigurationDescription[] multiCfgs = null; // selected multi cfg
|
||||
// tabs
|
||||
private static final String EXTENSION_POINT_ID = "org.eclipse.cdt.ui.cPropertyTab"; //$NON-NLS-1$
|
||||
public static final String ELEMENT_NAME = "tab"; //$NON-NLS-1$
|
||||
|
@ -212,7 +213,6 @@ implements
|
|||
s = UIMessages.getString("AbstractPage.0"); //$NON-NLS-1$
|
||||
} else if (!isApplicable()) {
|
||||
return null;
|
||||
// s = UIMessages.getString("AbstractPage.1"); //$NON-NLS-1$
|
||||
} else if (!isCDTProject(getProject())) {
|
||||
s = UIMessages.getString("AbstractPage.2"); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -380,24 +380,26 @@ implements
|
|||
|
||||
// Check if the user has selected the "all / multiple" configuration
|
||||
if (selectionIndex >= cfgDescs.length) {
|
||||
ICConfigurationDescription[] multiCfgs = null; // selected multi cfg
|
||||
if ((selectionIndex - cfgDescs.length) == 0) { // all
|
||||
multiCfgs = cfgDescs;
|
||||
cfgIndex = selectionIndex;
|
||||
} else {
|
||||
ICConfigurationDescription[] mcfgs = ConfigMultiSelectionDialog.select(cfgDescs);
|
||||
if (mcfgs == null || mcfgs.length == 0) {
|
||||
// return back to previous selection
|
||||
if (cfgIndex > configSelector.getItemCount()) {
|
||||
cfgIndex = 0;
|
||||
configSelector.select(0);
|
||||
cfgChanged(cfgDescs[0]);
|
||||
} else {
|
||||
configSelector.select(cfgIndex);
|
||||
} else { // multiple
|
||||
if (cfgIndex != selectionIndex) { // to avoid re-request on page change
|
||||
ICConfigurationDescription[] mcfgs = ConfigMultiSelectionDialog.select(cfgDescs);
|
||||
if (mcfgs == null || mcfgs.length == 0) {
|
||||
// return back to previous selection
|
||||
if (cfgIndex > configSelector.getItemCount()) {
|
||||
cfgIndex = 0;
|
||||
configSelector.select(0);
|
||||
cfgChanged(cfgDescs[0]);
|
||||
} else {
|
||||
configSelector.select(cfgIndex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
multiCfgs = mcfgs;
|
||||
cfgIndex = selectionIndex;
|
||||
}
|
||||
multiCfgs = mcfgs;
|
||||
}
|
||||
// TODO: avoid repeated update like for single cfg
|
||||
cfgChanged(MultiItemsHolder.createCDescription(multiCfgs,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -39,6 +39,7 @@ import org.eclipse.ui.PlatformUI;
|
|||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.CoreModelUtil;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiResourceDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -300,9 +301,13 @@ public class BinaryParsTab extends AbstractCPropertyTab {
|
|||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
if (page.isMultiCfg()) {
|
||||
src = ((ICResourceDescription[])((ICMultiResourceDescription)src).getItems())[0];
|
||||
dst = ((ICResourceDescription[])((ICMultiResourceDescription)dst).getItems())[0];
|
||||
}
|
||||
ICTargetPlatformSetting tps1 = src.getConfiguration().getTargetPlatformSetting();
|
||||
ICTargetPlatformSetting tps2 = dst.getConfiguration().getTargetPlatformSetting();
|
||||
if (tps1 != null && tps2 != null) { // temporary
|
||||
if (tps1 != null && tps2 != null) {
|
||||
tps2.setBinaryParserIds(tps1.getBinaryParserIds());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,12 +40,13 @@ public class ConfigMultiSelectionDialog extends Dialog {
|
|||
private CheckboxTableViewer tv;
|
||||
private Button b_ok;
|
||||
private Label message;
|
||||
private static ICConfigurationDescription[] result = null;
|
||||
|
||||
public static ICConfigurationDescription[] select(ICConfigurationDescription[] _cfgds) {
|
||||
cfgds = _cfgds;
|
||||
ConfigMultiSelectionDialog d = new ConfigMultiSelectionDialog(CUIPlugin.getActiveWorkbenchShell());
|
||||
if (d.open() == OK)
|
||||
return (ICConfigurationDescription[])d.tv.getCheckedElements();
|
||||
return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -104,6 +105,12 @@ public class ConfigMultiSelectionDialog extends Dialog {
|
|||
boolean enabled = (tv.getCheckedElements().length > 1);
|
||||
if (b_ok != null) b_ok.setEnabled(enabled);
|
||||
message.setVisible(!enabled);
|
||||
if (enabled) {
|
||||
Object[] ob = tv.getCheckedElements();
|
||||
result = new ICConfigurationDescription[ob.length];
|
||||
System.arraycopy(ob, 0, result, 0, ob.length);
|
||||
} else
|
||||
result = null;
|
||||
}});
|
||||
tv.setLabelProvider(new ITableLabelProvider() {
|
||||
public Image getColumnImage(Object element, int columnIndex) { return null; }
|
||||
|
|
Loading…
Add table
Reference in a new issue