Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAlena Laskavaia2008-07-11 14:26:02 +0000
committerAlena Laskavaia2008-07-11 14:26:02 +0000
commita10ab1f0bf1dbab3411c10b429f27940703aa61d (patch)
treee5668f8d2f33b684c01986526119a04ec8ed6712 /build
parent1f982fd80c0d5b8e8e241adf5c430d6079006f4e (diff)
downloadorg.eclipse.cdt-a10ab1f0bf1dbab3411c10b429f27940703aa61d.tar.gz
org.eclipse.cdt-a10ab1f0bf1dbab3411c10b429f27940703aa61d.tar.xz
org.eclipse.cdt-a10ab1f0bf1dbab3411c10b429f27940703aa61d.zip
[236186] - fixing bugs with make targets, contributed by Andrew Gvozdev
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java3
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java60
2 files changed, 33 insertions, 30 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java
index 304bc0d4d54..b098e5b9bc4 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java
@@ -375,6 +375,9 @@ public class ProjectTargets {
option = getString(node, TARGET_ARGUMENTS);
if (option != null) {
target.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, option);
+ } else if (!target.isDefaultBuildCmd()) {
+ // Clear build-arguments set in target constructor to project defaults
+ target.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
}
option = getString(node, BAD_TARGET);
if (option != null) {
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
index 6f48213b5d2..77ccd7d0df9 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java
@@ -81,6 +81,30 @@ public class MakeTargetDialog extends Dialog {
private boolean initializing = true;
/**
+ * A Listener class to verify correctness of input and display an error message
+ */
+ private class UpdateStatusLineListener implements Listener {
+
+ private void setStatusLine() {
+ fStatusLine.setErrorMessage(null);
+
+ if (targetNameText.getText().trim().equals("")) { //$NON-NLS-1$
+ fStatusLine.setErrorMessage(
+ MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyName")); //$NON-NLS-1$
+ } else if (commandText.isEnabled() && commandText.getText().trim().equals("")) { //$NON-NLS-1$
+ fStatusLine.setErrorMessage(
+ MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
+ }
+ }
+
+ public void handleEvent(Event e) {
+ setStatusLine();
+ updateButtons();
+ }
+
+ }
+
+ /**
* @param parentShell
*/
public MakeTargetDialog(Shell parentShell, IMakeTarget target) throws CoreException {
@@ -91,7 +115,7 @@ public class MakeTargetDialog extends Dialog {
buildCommand = target.getBuildCommand();
buildArguments = target.getBuildArguments();
targetName = target.getName();
- targetString = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, "all"); //$NON-NLS-1$
+ targetString = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, ""); //$NON-NLS-1$
targetBuildID = target.getTargetBuilderID();
runAllBuilders = target.runAllBuilders();
}
@@ -116,6 +140,8 @@ public class MakeTargetDialog extends Dialog {
buildCommand = buildInfo.getBuildCommand();
buildArguments = buildInfo.getBuildArguments();
targetString = buildInfo.getIncrementalBuildTarget();
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
}
protected void configureShell(Shell newShell) {
@@ -168,26 +194,8 @@ public class MakeTargetDialog extends Dialog {
targetNameText = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
((GridData) (targetNameText.getLayoutData())).horizontalAlignment = GridData.FILL;
((GridData) (targetNameText.getLayoutData())).grabExcessHorizontalSpace = true;
- targetNameText.addListener(SWT.Modify, new Listener() {
- public void handleEvent(Event e) {
- String newName = targetNameText.getText().trim();
- if (newName.equals("")) { //$NON-NLS-1$
- fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyName")); //$NON-NLS-1$
- } else
- try {
- if (fTarget != null && fTarget.getName().equals(newName)
- || fTargetManager.findTarget(fContainer, newName) == null) {
- fStatusLine.setErrorMessage(null);
- } else {
- fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.targetWithNameExists")); //$NON-NLS-1$
- }
- } catch (CoreException ex) {
- fStatusLine.setErrorMessage(ex.getLocalizedMessage());
- }
- updateButtons();
- }
- });
+ targetNameText.addListener(SWT.Modify, new UpdateStatusLineListener());
}
protected void createSettingControls(Composite parent) {
@@ -254,17 +262,9 @@ public class MakeTargetDialog extends Dialog {
commandText = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
((GridData) (commandText.getLayoutData())).horizontalAlignment = GridData.FILL;
((GridData) (commandText.getLayoutData())).grabExcessHorizontalSpace = true;
- commandText.addListener(SWT.Modify, new Listener() {
- public void handleEvent(Event e) {
- if (commandText.getText().equals("")) { //$NON-NLS-1$
- fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
- } else {
- fStatusLine.setErrorMessage(null);
- }
- updateButtons();
- }
- });
+ commandText.addListener(SWT.Modify, new UpdateStatusLineListener());
+
if (isDefaultCommand) {
commandText.setEnabled(false);
} else {

Back to the top