Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-11-14 14:41:32 -0500
committerAndrew Gvozdev2011-11-14 14:41:32 -0500
commit7f438e269a654630b386900056de3bcd83f9ccad (patch)
tree639a7e355880b3c9017b723a9b3db1bded3426cb /build/org.eclipse.cdt.managedbuilder.ui
parentbdd3e822167500622543cb8b332d3b9fbe8a253b (diff)
downloadorg.eclipse.cdt-7f438e269a654630b386900056de3bcd83f9ccad.tar.gz
org.eclipse.cdt-7f438e269a654630b386900056de3bcd83f9ccad.tar.xz
org.eclipse.cdt-7f438e269a654630b386900056de3bcd83f9ccad.zip
bug 259768: "Use optimal jobs number" highly misleading.
Encode "optimal" as negative number and "unlimited" as Integer.MAX_VALUE Based on patch by Mohamed Hussein <mohamed_hussein@mentor.com>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java258
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java15
4 files changed, 169 insertions, 118 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
index 7d4180d427..94f8c37d3f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
@@ -27,9 +27,10 @@ public class Messages extends NLS {
public static String BuilderSettingsTab_0;
public static String BuilderSettingsTab_1;
public static String BuilderSettingsTab_10;
- public static String BuilderSettingsTab_11;
- public static String BuilderSettingsTab_12;
- public static String BuilderSettingsTab_13;
+ public static String BuilderSettingsTab_EnableParallelBuild;
+ public static String BuilderSettingsTab_UseOptimalJobs;
+ public static String BuilderSettingsTab_UseUnlimitedJobs;
+ public static String BuilderSettingsTab_UseParallelJobs;
public static String BuilderSettingsTab_14;
public static String BuilderSettingsTab_15;
public static String BuilderSettingsTab_16;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
index 7bd9281d8e..3fdd4bfe8f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
@@ -31,9 +31,10 @@ BuilderSettingsTab_7=&Generate Makefiles automatically
BuilderSettingsTab_8=&Expand Env. Variable Refs in Makefiles
BuilderSettingsTab_9=Build settings
BuilderSettingsTab_10=Stop on first build error
-BuilderSettingsTab_11=Use parallel build
-BuilderSettingsTab_12=Use optimal jobs number
-BuilderSettingsTab_13=Use parallel jobs:
+BuilderSettingsTab_EnableParallelBuild=Enable parallel build
+BuilderSettingsTab_UseOptimalJobs=Use number of processors ({0})
+BuilderSettingsTab_UseParallelJobs=Use parallel jobs:
+BuilderSettingsTab_UseUnlimitedJobs=Use unlimited jobs
BuilderSettingsTab_14=Workbench Build Behavior
BuilderSettingsTab_15=Workbench build type:
BuilderSettingsTab_16=Make build target:
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 7acf0d9326..0193eeb236 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Intel Corporation and others.
+ * Copyright (c) 2007, 2011 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
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
+import java.text.MessageFormat;
+
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
@@ -18,12 +20,12 @@ 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.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.newmake.core.IMakeBuilderInfo;
+import org.eclipse.cdt.newmake.core.IMakeCommonBuildInfo;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.ICPropertyProvider;
import org.eclipse.core.runtime.CoreException;
@@ -51,6 +53,7 @@ import org.eclipse.swt.widgets.Widget;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
+ private static final int SPINNER_MAX_VALUE = 10000;
private static final int TRI_STATES_SIZE = 4;
// Widgets
@@ -58,9 +61,10 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
private Button b_stopOnError; // 3
private Button b_parallel; // 3
- private Button b_parallelOpt;
- private Button b_parallelNum;
- private Spinner parallelProcesses;
+ private Button b_parallelOptimal;
+ private Button b_parallelSpecific;
+ private Button b_parallelUnlimited;
+ private Spinner s_parallelNumber;
private Label title2;
private Button b_autoBuild; //3
@@ -70,11 +74,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
private Button b_cmdClean; // 3
private Text t_cmdClean;
- private IBuilder bldr;
+ private Builder bldr;
private IConfiguration icfg;
private boolean canModify = true;
- protected final int cpuNumber = BuildProcessManager.checkCPUNumber();
+ protected final int cpuNumber = Runtime.getRuntime().availableProcessors();
@Override
public void createControls(Composite parent) {
@@ -110,7 +114,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
gl.marginHeight = 0;
c2.setLayout(gl);
- b_parallel = setupCheck(c2, Messages.BuilderSettingsTab_11, 1, GridData.BEGINNING);
+ b_parallel = setupCheck(c2, Messages.BuilderSettingsTab_EnableParallelBuild, 1, GridData.BEGINNING);
Composite c3 = new Composite(g3, SWT.NONE);
setupControl(c3, 1, GridData.FILL_BOTH);
@@ -120,39 +124,60 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
gl.marginHeight = 0;
c3.setLayout(gl);
- b_parallelOpt= new Button(c3, SWT.RADIO);
- b_parallelOpt.setText(Messages.BuilderSettingsTab_12);
- setupControl(b_parallelOpt, 2, GridData.BEGINNING);
- ((GridData)(b_parallelOpt.getLayoutData())).horizontalIndent = 15;
- b_parallelOpt.addSelectionListener(new SelectionAdapter() {
+ b_parallelOptimal= new Button(c3, SWT.RADIO);
+ b_parallelOptimal.setText(MessageFormat.format(Messages.BuilderSettingsTab_UseOptimalJobs, 1));
+ setupControl(b_parallelOptimal, 2, GridData.BEGINNING);
+ ((GridData)(b_parallelOptimal.getLayoutData())).horizontalIndent = 15;
+ b_parallelOptimal.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- setParallelDef(b_parallelOpt.getSelection());
- updateButtons();
+ if (b_parallelOptimal.getSelection()) {
+ setParallelDef(true);
+ setParallelNumber(-1);
+ updateButtons();
+ }
}});
- b_parallelNum= new Button(c3, SWT.RADIO);
- b_parallelNum.setText(Messages.BuilderSettingsTab_13);
- setupControl(b_parallelNum, 1, GridData.BEGINNING);
- ((GridData)(b_parallelNum.getLayoutData())).horizontalIndent = 15;
- b_parallelNum.addSelectionListener(new SelectionAdapter() {
+ b_parallelSpecific= new Button(c3, SWT.RADIO);
+ b_parallelSpecific.setText(Messages.BuilderSettingsTab_UseParallelJobs);
+ setupControl(b_parallelSpecific, 1, GridData.BEGINNING);
+ ((GridData)(b_parallelSpecific.getLayoutData())).horizontalIndent = 15;
+ b_parallelSpecific.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- setParallelDef(!b_parallelNum.getSelection());
- updateButtons();
+ if (b_parallelSpecific.getSelection()) {
+ setParallelDef(true);
+ setParallelNumber(s_parallelNumber.getSelection());
+ updateButtons();
+ }
}});
- parallelProcesses = new Spinner(c3, SWT.BORDER);
- setupControl(parallelProcesses, 1, GridData.BEGINNING);
- parallelProcesses.setValues(cpuNumber, 1, 10000, 0, 1, 10);
- parallelProcesses.addSelectionListener(new SelectionAdapter () {
+ s_parallelNumber = new Spinner(c3, SWT.BORDER);
+ setupControl(s_parallelNumber, 1, GridData.BEGINNING);
+ s_parallelNumber.setValues(cpuNumber, 1, SPINNER_MAX_VALUE, 0, 1, 10);
+ s_parallelNumber.addSelectionListener(new SelectionAdapter () {
@Override
public void widgetSelected(SelectionEvent e) {
- setParallelNumber(parallelProcesses.getSelection());
+ setParallelDef(true);
+ setParallelNumber(s_parallelNumber.getSelection());
updateButtons();
}
});
+ b_parallelUnlimited= new Button(c3, SWT.RADIO);
+ b_parallelUnlimited.setText(Messages.BuilderSettingsTab_UseUnlimitedJobs);
+ setupControl(b_parallelUnlimited, 2, GridData.BEGINNING);
+ ((GridData)(b_parallelUnlimited.getLayoutData())).horizontalIndent = 15;
+ b_parallelUnlimited.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ if (b_parallelUnlimited.getSelection()) {
+ setParallelDef(true);
+ setParallelNumber(Integer.MAX_VALUE);
+ updateButtons();
+ }
+ }});
+
// Workbench behaviour group
AccessibleListener makeTargetLabelAccessibleListener = new AccessibleAdapter() {
@Override
@@ -166,6 +191,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
b_autoBuild = setupCheck(g4, Messages.BuilderSettingsTab_17, 1, GridData.BEGINNING);
t_autoBuild = setupBlock(g4, b_autoBuild);
t_autoBuild.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify)
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, t_autoBuild.getText());
@@ -175,6 +201,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
b_cmdBuild = setupCheck(g4, Messages.BuilderSettingsTab_19, 1, GridData.BEGINNING);
t_cmdBuild = setupBlock(g4, b_cmdBuild);
t_cmdBuild.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify)
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, t_cmdBuild.getText());
@@ -183,6 +210,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
b_cmdClean = setupCheck(g4, Messages.BuilderSettingsTab_20, 1, GridData.BEGINNING);
t_cmdClean = setupBlock(g4, b_cmdClean);
t_cmdClean.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (canModify)
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, t_cmdClean.getText());
@@ -191,6 +219,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
}
/**
+ * Calculate enablements when multiple configurations selected on property page.
*
* @return:
* Mode 0:
@@ -202,56 +231,55 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
* 0: isStopOnError
* 1: supportsStopOnError(true)
* 2: bld.supportsStopOnError(false)
- * 3: cfg.getInternalBuilderParallel()
+ * 3: cfg.getParallelDef()
* Mode 2:
* 0: b.isAutoBuildEnable()
* 1: b.isIncrementalBuildEnabled()
* 2: b.isCleanBuildEnabled()
* 3: getParallelDef()
*/
- static int[] calc3states(ICPropertyProvider p,
- IConfiguration c,
- int mode) {
- if (p.isMultiCfg() &&
- c instanceof ICMultiItemsHolder)
- {
- boolean p0 = (mode == 0);
- boolean p1 = (mode == 1);
+ static int[] calc3states(ICPropertyProvider p, IConfiguration mcfg, int mode) {
+ if (p.isMultiCfg() && mcfg instanceof ICMultiItemsHolder) {
+ boolean m0 = (mode == 0);
+ boolean m1 = (mode == 1);
- IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
- IBuilder b = cfs[0].getBuilder();
- int[] res = new int[TRI_STATES_SIZE];
- boolean[] x = new boolean[TRI_STATES_SIZE];
- x[0] = p0 ? b.isManagedBuildOn() :
- (p1 ? b.isStopOnError() : b.isAutoBuildEnable());
- x[1] = p0 ? b.isDefaultBuildCmd():
- (p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled() );
- x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
- (p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled());
- x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() :
- ( p1 ? ((Configuration)cfs[0]).getInternalBuilderParallel() : getParallelDef(c));
- for (int i=1; i<cfs.length; i++) {
- b = cfs[i].getBuilder();
- if (x[0] != (p0 ? b.isManagedBuildOn() :
- (p1 ? b.isStopOnError() : b.isAutoBuildEnable())))
+ IConfiguration[] cfgs = (IConfiguration[])((ICMultiItemsHolder)mcfg).getItems();
+ IBuilder bldr0 = cfgs[0].getBuilder();
+ int[] res = new int[TRI_STATES_SIZE];
+ boolean[] b = new boolean[TRI_STATES_SIZE];
+ b[0] = m0 ? bldr0.isManagedBuildOn() :
+ (m1 ? bldr0.isStopOnError() : bldr0.isAutoBuildEnable());
+ b[1] = m0 ? bldr0.isDefaultBuildCmd():
+ (m1 ? bldr0.supportsStopOnError(true) : bldr0.isIncrementalBuildEnabled() );
+ b[2] = m0 ? bldr0.canKeepEnvironmentVariablesInBuildfile() :
+ (m1 ? bldr0.supportsStopOnError(false) : bldr0.isCleanBuildEnabled());
+ b[3] = m0 ? bldr0.keepEnvironmentVariablesInBuildfile() :
+ (m1 ? ((Configuration)cfgs[0]).getParallelDef() : getParallelDef(mcfg));
+ for (int i=1; i<cfgs.length; i++) {
+ IBuilder bldr = cfgs[i].getBuilder();
+ if (b[0] != (m0 ? bldr.isManagedBuildOn() :
+ (m1 ? bldr.isStopOnError() : bldr.isAutoBuildEnable())))
res[0] = TRI_UNKNOWN;
- if (x[1] != (p0 ? b.isDefaultBuildCmd() :
- (p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled())))
+ if (b[1] != (m0 ? bldr.isDefaultBuildCmd() :
+ (m1 ? bldr.supportsStopOnError(true) : bldr.isIncrementalBuildEnabled())))
res[1] = TRI_UNKNOWN;
- if (x[2] != (p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
- (p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled())))
+ if (b[2] != (m0 ? bldr.canKeepEnvironmentVariablesInBuildfile() :
+ (m1 ? bldr.supportsStopOnError(false) : bldr.isCleanBuildEnabled())))
res[2] = TRI_UNKNOWN;
- if (x[3] != (p0 ? b.keepEnvironmentVariablesInBuildfile() :
- (p1 ? ((Configuration)cfs[i]).getInternalBuilderParallel() : getParallelDef(c))))
+ if ((b[3] != (m0 ? bldr.keepEnvironmentVariablesInBuildfile() :
+ (m1 ? ((Configuration)cfgs[i]).getParallelDef() : getParallelDef(mcfg))))
+ || ((IMultiConfiguration) mcfg).getParallelNumber() == 0) {
res[3] = TRI_UNKNOWN;
+ }
}
for (int i=0; i<TRI_STATES_SIZE; i++) {
if (res[i] != TRI_UNKNOWN)
- res[i] = x[i] ? TRI_YES : TRI_NO;
+ res[i] = b[i] ? TRI_YES : TRI_NO;
}
return res;
- } else
- return null;
+ }
+
+ return null;
}
/**
@@ -259,10 +287,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
*/
@Override
protected void updateButtons() {
- bldr = icfg.getEditableBuilder();
+ bldr = (Builder) icfg.getEditableBuilder();
canModify = false;
int[] extStates = calc3states(page, icfg, 1);
+ // Stop on error
if (extStates != null) {
setTriSelection(b_stopOnError, extStates[0]);
b_stopOnError.setEnabled(
@@ -273,42 +302,62 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
b_stopOnError.setEnabled(
bldr.supportsStopOnError(true) &&
bldr.supportsStopOnError(false));
- }
- // parallel
- if (extStates == null) // no extended states
- setTriSelection(b_parallel, getInternalBuilderParallel());
- else
- setTriSelection(b_parallel, extStates[3]);
+ }
- int n = getParallelNumber();
- if (n < 0) n = -n;
- parallelProcesses.setSelection(n);
+ // Parallel build
+ boolean isParallelSupported = bldr.supportsParallelBuild();
+ boolean isExternalBuilder = ! isInternalBuilderEnabled();
- b_parallel.setVisible(bldr.supportsParallelBuild());
- b_parallelOpt.setVisible(bldr.supportsParallelBuild());
- b_parallelNum.setVisible(bldr.supportsParallelBuild());
- parallelProcesses.setVisible(bldr.supportsParallelBuild());
+ b_parallel.setVisible(isParallelSupported);
+ b_parallelOptimal.setVisible(isParallelSupported);
+ b_parallelSpecific.setVisible(isParallelSupported);
+ b_parallelUnlimited.setVisible(isParallelSupported && isExternalBuilder);
+ s_parallelNumber.setVisible(isParallelSupported);
- extStates = calc3states(page, icfg, 2);
- if (extStates == null) {
- setTriSelection(b_autoBuild, bldr.isAutoBuildEnable());
- setTriSelection(b_cmdBuild, bldr.isIncrementalBuildEnabled());
- setTriSelection(b_cmdClean, bldr.isCleanBuildEnabled());
- b_parallelOpt.setSelection(getParallelDef(icfg));
- b_parallelNum.setSelection(!getParallelDef(icfg));
- } else {
- setTriSelection(b_autoBuild, extStates[0]);
- setTriSelection(b_cmdBuild, extStates[1]);
- setTriSelection(b_cmdClean, extStates[2]);
- if (extStates[3] == TRI_UNKNOWN) {
- b_parallelOpt.setSelection(false);
- b_parallelNum.setSelection(false);
+ if (isParallelSupported) {
+ if (extStates == null) {
+ setTriSelection(b_parallel, getParallelDef());
} else {
- b_parallelOpt.setSelection(getParallelDef(icfg));
- b_parallelNum.setSelection(!getParallelDef(icfg));
+ setTriSelection(b_parallel, extStates[3]);
+ }
+ boolean isParallelSelected = b_parallel.getSelection();
+ int optimalParallelNumber = bldr.getOptimalParallelJobNum();
+
+ b_parallelOptimal.setText(MessageFormat.format(Messages.BuilderSettingsTab_UseOptimalJobs, optimalParallelNumber));
+ b_parallelOptimal.setEnabled(isParallelSelected);
+ b_parallelSpecific.setEnabled(isParallelSelected);
+ b_parallelUnlimited.setEnabled(isParallelSelected && isExternalBuilder);
+
+ extStates = calc3states(page, icfg, 2);
+ if (extStates == null) {
+ setTriSelection(b_autoBuild, bldr.isAutoBuildEnable());
+ setTriSelection(b_cmdBuild, bldr.isIncrementalBuildEnabled());
+ setTriSelection(b_cmdClean, bldr.isCleanBuildEnabled());
+ } else { // multiple configurations selected
+ setTriSelection(b_autoBuild, extStates[0]);
+ setTriSelection(b_cmdBuild, extStates[1]);
+ setTriSelection(b_cmdClean, extStates[2]);
+ }
+ if ((extStates == null || extStates[3] != TRI_UNKNOWN) && isParallelSelected) {
+ // single configuration or matching multiple configurations here
+ int parallelNumber = getParallelNumber();
+ boolean isOptimal = parallelNumber <= 0;
+ boolean isUnlimited = parallelNumber == Integer.MAX_VALUE;
+ b_parallelOptimal.setSelection(isOptimal);
+ b_parallelSpecific.setSelection(!isOptimal && !isUnlimited);
+ b_parallelUnlimited.setSelection(isUnlimited);
+ s_parallelNumber.setEnabled(b_parallelSpecific.getEnabled() && b_parallelSpecific.getSelection());
+ s_parallelNumber.setSelection(s_parallelNumber.isEnabled() ? parallelNumber : optimalParallelNumber);
+ } else {
+ b_parallelOptimal.setSelection(true);
+ b_parallelSpecific.setSelection(false);
+ b_parallelUnlimited.setSelection(false);
+ s_parallelNumber.setEnabled(false);
+ s_parallelNumber.setSelection(optimalParallelNumber);
}
}
+ // Build commands
if (page.isMultiCfg()) {
MultiConfiguration mc = (MultiConfiguration)icfg;
t_autoBuild.setText(mc.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR));
@@ -320,13 +369,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
t_cmdClean.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR));
}
- boolean external = ! isInternalBuilderEnabled();
- boolean parallel = b_parallel.getSelection();
-
- b_parallelNum.setEnabled(parallel);
- b_parallelOpt.setEnabled(parallel);
- parallelProcesses.setEnabled(parallel & b_parallelNum.getSelection());
-
+ boolean external = ! isInternalBuilderEnabled();
title2.setVisible(external);
t_autoBuild.setVisible(external);
((Control)t_autoBuild.getData()).setVisible(external);
@@ -496,6 +539,14 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
return false;
}
+ private boolean getParallelDef() {
+ if (icfg instanceof Configuration)
+ return ((Configuration)icfg).getParallelDef();
+ if (icfg instanceof IMultiConfiguration)
+ return ((IMultiConfiguration)icfg).getParallelDef();
+ return false;
+ }
+
private void setParallelDef(boolean def) {
if (icfg instanceof Configuration)
((Configuration)icfg).setParallelDef(def);
@@ -503,6 +554,9 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
((IMultiConfiguration)icfg).setParallelDef(def);
}
+ /**
+ * @see IMakeCommonBuildInfo#getParallelizationNum() for interpretation of the number.
+ */
private int getParallelNumber() {
if (icfg instanceof Configuration)
return ((Configuration)icfg).getParallelNumber();
@@ -517,14 +571,6 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
((IMultiConfiguration)icfg).setParallelNumber(num);
}
- private boolean getInternalBuilderParallel() {
- if (icfg instanceof Configuration)
- return ((Configuration)icfg).getInternalBuilderParallel();
- if (icfg instanceof IMultiConfiguration)
- return ((IMultiConfiguration)icfg).getInternalBuilderParallel();
- return false;
- }
-
private boolean isInternalBuilderEnabled() {
if (icfg instanceof Configuration)
return ((Configuration)icfg).isInternalBuilderEnabled();
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 1ac54359f7..f36ce4480e 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
@@ -171,7 +171,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
canEnableInternalBuilder(true) &&
canEnableInternalBuilder(false));
- t_buildCmd.setText(getMC());
+ t_buildCmd.setText(getMakeCommand());
if (page.isMultiCfg()) {
group_dir.setVisible(false);
@@ -293,11 +293,14 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
/**
* @return make command
*/
- private String getMC() {
- String makeCommand = bldr.getCommand();
- String makeArgs = bldr.getArguments();
- if (makeArgs != null) { makeCommand += " " + makeArgs; } //$NON-NLS-1$
- return makeCommand;
+ private String getMakeCommand() {
+ String makeCommand = icfg.getBuildCommand();
+ String makeArgs = icfg.getBuildArguments();
+
+ if (!makeCommand.isEmpty() && makeArgs != null) {
+ return makeCommand + " " + makeArgs; //$NON-NLS-1$
+ }
+ return EMPTY_STR;
}
/**
* Performs common settings for all controls

Back to the top