Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorOleg Krasilnikov2008-02-01 16:24:01 +0000
committerOleg Krasilnikov2008-02-01 16:24:01 +0000
commitbfda3445f7b58e04f5814bdbb1c6059c5ef570c3 (patch)
tree850426ba7f6cab83982ca3cd986aa431a169995a /build
parentf4087a09fc43eaa905e8e47fed752ac2a7faae0d (diff)
downloadorg.eclipse.cdt-bfda3445f7b58e04f5814bdbb1c6059c5ef570c3.tar.gz
org.eclipse.cdt-bfda3445f7b58e04f5814bdbb1c6059c5ef570c3.tar.xz
org.eclipse.cdt-bfda3445f7b58e04f5814bdbb1c6059c5ef570c3.zip
Multi-config updates.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java45
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java149
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractCBuildPropertyTab.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java59
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java57
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java44
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java8
11 files changed, 296 insertions, 91 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index f71fb073a53..570c3652993 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -83,6 +83,7 @@ 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.MultiFolderInfo;
import org.eclipse.cdt.managedbuilder.internal.core.MultiResourceInfo;
import org.eclipse.cdt.managedbuilder.internal.core.Option;
import org.eclipse.cdt.managedbuilder.internal.core.OptionCategory;
@@ -1691,11 +1692,18 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
*/
public static void resetConfiguration(IProject project, IConfiguration configuration) {
// reset the configuration
- ((Configuration)configuration).reset();
-
- performValueHandlerEvent(configuration,
- IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
-
+ if (configuration instanceof MultiConfiguration) {
+ IConfiguration[] cfs = (IConfiguration[])((MultiConfiguration)configuration).getItems();
+ for (IConfiguration c : cfs) {
+ ((Configuration)c).reset();
+ performValueHandlerEvent(c,
+ IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
+ }
+ } else {
+ ((Configuration)configuration).reset();
+ performValueHandlerEvent(configuration,
+ IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
+ }
}
public static void resetResourceConfiguration(IProject project, IResourceConfiguration resConfig) {
@@ -1709,17 +1717,34 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
public static void resetOptionSettings(IResourceInfo rcInfo){
if(rcInfo instanceof IFileInfo){
- Configuration cfg = (Configuration)rcInfo.getParent();
- IProject project;
+ IConfiguration c = rcInfo.getParent();
+ Configuration cfg = null;
+ IProject project = null;
+ if (c instanceof Configuration)
+ cfg = (Configuration)c;
+ else if (c instanceof MultiConfiguration) {
+ MultiConfiguration mc = (MultiConfiguration)c;
+ IConfiguration[] cfs = (IConfiguration[])mc.getItems();
+ cfg = (Configuration)cfs[0];
+ }
if(cfg.isExtensionElement() || cfg.isPreference())
project = null;
else
project = cfg.getOwner().getProject();
- resetResourceConfiguration(project, (IFileInfo)rcInfo);
+ if (rcInfo instanceof MultiResourceInfo) {
+ for (IResourceInfo ri : (IResourceInfo[])((MultiResourceInfo)rcInfo).getItems())
+ resetResourceConfiguration(project, (IFileInfo)ri);
+ } else
+ resetResourceConfiguration(project, (IFileInfo)rcInfo);
} else {
- FolderInfo fo = (FolderInfo)rcInfo;
- fo.resetOptionSettings();
+ if (rcInfo instanceof MultiFolderInfo) {
+ for (IFolderInfo fi : (IFolderInfo[])((MultiFolderInfo)rcInfo).getItems())
+ ((FolderInfo)fi).resetOptionSettings();
+ } else {
+ FolderInfo fo = (FolderInfo)rcInfo;
+ fo.resetOptionSettings();
+ }
}
}
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
index 7910da5e2e3..10712f62945 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
@@ -578,7 +578,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
System.arraycopy(ris, 0, fis, 0, ris.length);
return new MultiFolderInfo(fis, this);
}
- return new MultiResourceInfo(ris, this);
+ return new MultiFileInfo(ris, this);
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java
new file mode 100644
index 00000000000..01df1a52816
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * 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.CFileData;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IFileInfo;
+import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.core.resources.IResource;
+
+/**
+ *
+ */
+public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
+
+ public MultiFileInfo(IResourceInfo[] ris, IConfiguration p) {
+ super(ris, p);
+ fRis = ris;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IFileInfo#getFileData()
+ */
+ public CFileData getFileData() {
+ return ((IFileInfo)fRis[curr]).getFileData();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#createTool(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String, boolean)
+ */
+ public ITool createTool(ITool superClass, String Id, String name,
+ boolean isExtensionElement) {
+ ITool t = null;
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ t = fi.createTool(superClass, Id, name, isExtensionElement);
+ }
+ }
+ return t;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getOwner()
+ */
+ public IResource getOwner() {
+ return ((IFileInfo)fRis[curr]).getOwner();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
+ */
+ public int getRcbsApplicability() {
+ return ((IFileInfo)fRis[curr]).getRcbsApplicability();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getResourcePath()
+ */
+ public String getResourcePath() {
+ return ((IFileInfo)fRis[curr]).getResourcePath();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getTool(java.lang.String)
+ */
+ public ITool getTool(String id) {
+ return ((IFileInfo)fRis[curr]).getTool(id);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getToolsToInvoke()
+ */
+ public ITool[] getToolsToInvoke() {
+ return ((IFileInfo)fRis[curr]).getToolsToInvoke();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#removeTool(org.eclipse.cdt.managedbuilder.core.ITool)
+ */
+ public void removeTool(ITool tool) {
+ System.out.println("MultiFileInfo.removeTool() does not work OK !");
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ fi.removeTool(tool);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setRcbsApplicability(int)
+ */
+ public void setRcbsApplicability(int value) {
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ fi.setRcbsApplicability(value);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setResourcePath(java.lang.String)
+ */
+ public void setResourcePath(String path) {
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ fi.setResourcePath(path);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
+ */
+ public void setToolCommand(ITool tool, String command) {
+ System.out.println("MultiFileInfo.setToolCommand() does not work OK !");
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ fi.setToolCommand(tool, command);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setTools(org.eclipse.cdt.managedbuilder.core.ITool[])
+ */
+ public void setTools(ITool[] tools) {
+ for (IResourceInfo ri : fRis) {
+ if (ri instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo)ri;
+ fi.setTools(tools);
+ }
+ }
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
index e90278d1546..1d02c115fe5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
@@ -28,7 +28,7 @@ import org.eclipse.core.runtime.PluginVersionIdentifier;
* belonging to different configurations while they are
* edited simultaneously.
*/
-public class MultiResourceInfo extends MultiItemsHolder implements
+public abstract class MultiResourceInfo extends MultiItemsHolder implements
IResourceInfo {
private static final int MODE_BOOL = 0;
private static final int MODE_STR = 1;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractCBuildPropertyTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractCBuildPropertyTab.java
index 25d2a2b45cc..03eec0b57fb 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractCBuildPropertyTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractCBuildPropertyTab.java
@@ -46,7 +46,7 @@ public abstract class AbstractCBuildPropertyTab extends AbstractCPropertyTab {
public IConfiguration getCfg() {
return getCfg(getResDesc().getConfiguration());
}
- public IConfiguration getCfg(ICConfigurationDescription cfgd) {
+ public static IConfiguration getCfg(ICConfigurationDescription cfgd) {
if (cfgd instanceof ICMultiConfigDescription) {
ICConfigurationDescription[] cfds = (ICConfigurationDescription[])((ICMultiConfigDescription)cfgd).getItems();
return new MultiConfiguration(cfds, 9);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java
index ccd985ea2e1..820fa783e61 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java
@@ -11,12 +11,15 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildProcessManager;
+import org.eclipse.cdt.managedbuilder.internal.core.Builder;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
import org.eclipse.cdt.newmake.core.IMakeBuilderInfo;
@@ -395,12 +398,57 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
}
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
- Configuration cfg01 = (Configuration)getCfg(src.getConfiguration());
- Configuration cfg02 = (Configuration)getCfg(dst.getConfiguration());
+ apply(src, dst, page.isMultiCfg());
+ }
+
+ static void apply(ICResourceDescription src, ICResourceDescription dst, boolean multi) {
+ if (multi) {
+ ICMultiConfigDescription mc1 = (ICMultiConfigDescription)src.getConfiguration();
+ ICMultiConfigDescription mc2 = (ICMultiConfigDescription)dst.getConfiguration();
+ ICConfigurationDescription[] cds1 = (ICConfigurationDescription[])mc1.getItems();
+ ICConfigurationDescription[] cds2 = (ICConfigurationDescription[])mc2.getItems();
+ for (int i=0; i<cds1.length; i++)
+ applyToCfg(cds1[i], cds2[i]);
+ } else
+ applyToCfg(src.getConfiguration(), dst.getConfiguration());
+ }
+
+ private static void applyToCfg(ICConfigurationDescription c1, ICConfigurationDescription c2) {
+ Configuration cfg01 = (Configuration)getCfg(c1);
+ Configuration cfg02 = (Configuration)getCfg(c2);
cfg02.enableInternalBuilder(cfg01.isInternalBuilderEnabled());
- BuilderSettingsTab.copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
+ copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
}
+ static void copyBuilders(IBuilder b1, IBuilder b2) {
+ try {
+ b2.setUseDefaultBuildCmd(b1.isDefaultBuildCmd());
+ if (!b1.isDefaultBuildCmd()) {
+ b2.setCommand(b1.getCommand());
+ b2.setArguments(b1.getArguments());
+ } else {
+ b2.setCommand(null);
+ b2.setArguments(null);
+ }
+ b2.setStopOnError(b1.isStopOnError());
+ b2.setParallelBuildOn(b1.isParallelBuildOn());
+ b2.setParallelizationNum(b1.getParallelizationNum());
+ if (b2.canKeepEnvironmentVariablesInBuildfile())
+ b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
+ ((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
+
+ b2.setAutoBuildEnable((b1.isAutoBuildEnable()));
+ b2.setBuildAttribute(IBuilder.BUILD_TARGET_AUTO, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR)));
+ b2.setCleanBuildEnable(b1.isCleanBuildEnabled());
+ b2.setBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR)));
+ b2.setIncrementalBuildEnable(b1.isIncrementalBuildEnabled());
+ b2.setBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR)));
+
+ b2.setManagedBuildOn(b1.isManagedBuildOn());
+ } catch (CoreException ex) {
+ ManagedBuilderUIPlugin.log(ex);
+ }
+ }
// This page can be displayed for project only
public boolean canBeVisible() {
return page.isForProject() || page.isForPrefs();
@@ -410,15 +458,16 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
super.setVisible(b);
}
+
protected void performDefaults() {
if (icfg instanceof IMultiConfiguration) {
IConfiguration[] cfs = (IConfiguration[])((IMultiConfiguration)icfg).getItems();
for (int i=0; i<cfs.length; i++) {
IBuilder b = cfs[i].getEditableBuilder();
- BuilderSettingsTab.copyBuilders(b.getSuperClass(), b);
+ copyBuilders(b.getSuperClass(), b);
}
} else
- BuilderSettingsTab.copyBuilders(bldr.getSuperClass(), bldr);
+ copyBuilders(bldr.getSuperClass(), bldr);
updateData(getResDesc());
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
index d187383154b..e28129f164a 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
+import org.eclipse.cdt.core.settings.model.ICMultiResourceDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -292,7 +293,6 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
return path.toString();
}
-
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
if (page.isForProject()) {
IConfiguration cfg1 = getCfg(src.getConfiguration());
@@ -302,31 +302,40 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
cfg2.setPostbuildStep(cfg1.getPostbuildStep());
cfg2.setPostannouncebuildStep(cfg1.getPostannouncebuildStep());
} else {
- IFileInfo rcfg1 = (IFileInfo)getResCfg(src);
- IFileInfo rcfg2 = (IFileInfo)getResCfg(dst);
- rcfg2.setRcbsApplicability(rcfg1.getRcbsApplicability());
- ITool tool1 = getRcbsTool(rcfg1);
- ITool tool2 = getRcbsTool(rcfg2);
-
- IInputType[] ein1 = tool1.getInputTypes();
- IInputType[] ein2 = tool2.getInputTypes();
- if (valid(ein1) && valid(ein2)) {
- IAdditionalInput[] add1 = ein1[0].getAdditionalInputs();
- IAdditionalInput[] add2 = ein2[0].getAdditionalInputs();
- if (valid(add1) && valid(add2)) {
-// if (add1 != null && add2 != null && add1.length > 0 && add2.length > 0) {
- add2[0].setPaths(createList(add1[0].getPaths()));
- }
- }
- IOutputType[] tmp1 = tool1.getOutputTypes();
- IOutputType[] tmp2 = tool2.getOutputTypes();
-// if (tmp1 != null && tmp2 != null && tmp1.length > 0 && tmp2.length > 0) {
- if (valid(tmp1) && valid(tmp2)) {
- tmp2[0].setOutputNames(createList(tmp1[0].getOutputNames()));
+ if (page.isMultiCfg()) {
+ ICResourceDescription[] ris1 = (ICResourceDescription[])((ICMultiResourceDescription)src).getItems();
+ ICResourceDescription[] ris2 = (ICResourceDescription[])((ICMultiResourceDescription)dst).getItems();
+ for (int i=0; i<ris1.length; i++)
+ applyToFile(ris1[i], ris2[i]);
+ } else
+ applyToFile(src, dst);
+ }
+ }
+
+ private void applyToFile(ICResourceDescription src, ICResourceDescription dst) {
+ IFileInfo rcfg1 = (IFileInfo)getResCfg(src);
+ IFileInfo rcfg2 = (IFileInfo)getResCfg(dst);
+ rcfg2.setRcbsApplicability(rcfg1.getRcbsApplicability());
+ ITool tool1 = getRcbsTool(rcfg1);
+ ITool tool2 = getRcbsTool(rcfg2);
+ IInputType[] ein1 = tool1.getInputTypes();
+ IInputType[] ein2 = tool2.getInputTypes();
+ if (valid(ein1) && valid(ein2)) {
+ IAdditionalInput[] add1 = ein1[0].getAdditionalInputs();
+ IAdditionalInput[] add2 = ein2[0].getAdditionalInputs();
+ if (valid(add1) && valid(add2)) {
+// if (add1 != null && add2 != null && add1.length > 0 && add2.length > 0) {
+ add2[0].setPaths(createList(add1[0].getPaths()));
}
- tool2.setToolCommand(tool1.getToolCommand());
- tool2.setAnnouncement(tool1.getAnnouncement());
}
+ IOutputType[] tmp1 = tool1.getOutputTypes();
+ IOutputType[] tmp2 = tool2.getOutputTypes();
+// if (tmp1 != null && tmp2 != null && tmp1.length > 0 && tmp2.length > 0) {
+ if (valid(tmp1) && valid(tmp2)) {
+ tmp2[0].setOutputNames(createList(tmp1[0].getOutputNames()));
+ }
+ tool2.setToolCommand(tool1.getToolCommand());
+ tool2.setAnnouncement(tool1.getAnnouncement());
}
private int sel2app(int index){
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java
index 243109ae39b..f71def95e35 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java
@@ -15,7 +15,6 @@ import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
-import org.eclipse.cdt.managedbuilder.internal.core.Builder;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
import org.eclipse.cdt.ui.CUIPlugin;
@@ -119,7 +118,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
b_dirVars = setupBottomButton(c, VARIABLESBUTTON_NAME);
}
- void setManagedBuild(boolean enable) {
+ private void setManagedBuild(boolean enable) {
setManagedBuildOn(enable);
page.informPages(MANAGEDBUILDSTATE, null);
updateButtons();
@@ -192,7 +191,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
canModify = true;
}
- Button setupBottomButton(Composite c, String name) {
+ private Button setupBottomButton(Composite c, String name) {
Button b = new Button(c, SWT.PUSH);
b.setText(name);
GridData fd = new GridData(GridData.CENTER);
@@ -302,42 +301,9 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
}
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
- Configuration cfg01 = (Configuration)getCfg(src.getConfiguration());
- Configuration cfg02 = (Configuration)getCfg(dst.getConfiguration());
- cfg02.enableInternalBuilder(cfg01.isInternalBuilderEnabled());
- copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
+ BuildBehaviourTab.apply(src, dst, page.isMultiCfg());
}
- static void copyBuilders(IBuilder b1, IBuilder b2) {
- try {
- b2.setUseDefaultBuildCmd(b1.isDefaultBuildCmd());
- if (!b1.isDefaultBuildCmd()) {
- b2.setCommand(b1.getCommand());
- b2.setArguments(b1.getArguments());
- } else {
- b2.setCommand(null);
- b2.setArguments(null);
- }
- b2.setStopOnError(b1.isStopOnError());
- b2.setParallelBuildOn(b1.isParallelBuildOn());
- b2.setParallelizationNum(b1.getParallelizationNum());
- if (b2.canKeepEnvironmentVariablesInBuildfile())
- b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
- ((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
-
- b2.setAutoBuildEnable((b1.isAutoBuildEnable()));
- b2.setBuildAttribute(IBuilder.BUILD_TARGET_AUTO, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR)));
- b2.setCleanBuildEnable(b1.isCleanBuildEnabled());
- b2.setBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR)));
- b2.setIncrementalBuildEnable(b1.isIncrementalBuildEnabled());
- b2.setBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR)));
-
- b2.setManagedBuildOn(b1.isManagedBuildOn());
- } catch (CoreException ex) {
- ManagedBuilderUIPlugin.log(ex);
- }
- }
-
/* (non-Javadoc)
*
* @param string
@@ -365,10 +331,10 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
IConfiguration[] cfs = (IConfiguration[])((IMultiConfiguration)icfg).getItems();
for (int i=0; i<cfs.length; i++) {
IBuilder b = cfs[i].getEditableBuilder();
- copyBuilders(b.getSuperClass(), b);
+ BuildBehaviourTab.copyBuilders(b.getSuperClass(), b);
}
} else
- copyBuilders(bldr.getSuperClass(), bldr);
+ BuildBehaviourTab.copyBuilders(bldr.getSuperClass(), bldr);
updateData(getResDesc());
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
index 43e0f775dd5..886f34c8dbc 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
@@ -69,7 +69,6 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private static final String PROFILE_PAGE = "profilePage"; //$NON-NLS-1$
private static final String PROFILE_ID = "profileId"; //$NON-NLS-1$
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$
-// private static final String MULTI_MSG = Messages.getString("DiscoveryTab.4"); //$NON-NLS-1$
private static final int DEFAULT_HEIGHT = 110;
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
private Table resTable;
@@ -561,7 +560,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
public boolean canBeVisible() {
- if (page.isForProject() || page.isForPrefs()) return true;
+ if (page.isMultiCfg()) {
+ setAllVisible(false, null);
+ return false;
+ }
+ setAllVisible(true, null);
+ if (page.isForProject() || page.isForPrefs())
+ return true;
// Hide this page for folders and files
// if Discovery scope is "per configuration", not "per resource"
ICfgScannerConfigBuilderInfo2Set _cbi =
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
index 1509574f0d3..fd8030e7a51 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolChainEditTab.java
@@ -426,6 +426,8 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
}
protected void performApply(ICResourceDescription src,
ICResourceDescription dst) {
+ if (mod == null)
+ return;
IConfiguration cfg = getCfg(dst.getConfiguration());
try {
IToolListModification tlm = (ri instanceof IFolderInfo) ?
@@ -438,9 +440,11 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
}
protected void performDefaults() {
- mod.restoreDefaults();
- apply();
- updateData();
+ if (mod != null) {
+ mod.restoreDefaults();
+ apply();
+ updateData();
+ }
}
protected void updateButtons() {} // Do nothing. No buttons to update.
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
index 1e37a9035cc..64d0c93f2b6 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java
@@ -73,7 +73,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
private ToolListElement selectedElement;
private ToolListContentProvider listprovider;
private Object propertyObject;
-
+
private IResourceInfo fInfo;
public void createControls(Composite par) {
@@ -400,13 +400,11 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
*/
- public void performDefaults() {
+ protected void performDefaults() {
if (page.isForProject()) {
ManagedBuildManager.resetConfiguration(page.getProject(), getCfg());
} else {
-// ManagedBuildManager.resetResourceConfiguration(provider.getProject(), );
-// ManagedBuildManager.performValueHandlerEvent(fInfo, IManagedOptionValueHandler.EVENT_SETDEFAULT);
-
+ ManagedBuildManager.resetOptionSettings(fInfo);
}
ITool tools[];
if (page.isForProject())

Back to the top