mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
This commit is contained in:
parent
2c822f988a
commit
ea46f60dc2
5 changed files with 122 additions and 53 deletions
|
@ -33,6 +33,8 @@ public interface IMakeTarget {
|
||||||
String getBuildArguments();
|
String getBuildArguments();
|
||||||
void setBuildArguments(String arguments) throws CoreException;
|
void setBuildArguments(String arguments) throws CoreException;
|
||||||
|
|
||||||
|
void setRunAllBuilders(boolean runAllBuilders);
|
||||||
|
boolean runAllBuilders();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the target build container.
|
* Get the target build container.
|
||||||
|
|
|
@ -7,10 +7,10 @@ MakeBuilder.Creating_Markers=Generating markers...
|
||||||
|
|
||||||
BuildInfoFactory.Missing_Builder=Missing Builder:
|
BuildInfoFactory.Missing_Builder=Missing Builder:
|
||||||
|
|
||||||
MakeTargetManager.add_to_workspace_root=Cannot add build targets to workspace root
|
MakeTargetManager.add_to_workspace_root=Cannot add make targets to workspace root
|
||||||
MakeTargetManager.add_temporary_target=Cannot add temporart Target to manager.
|
MakeTargetManager.add_temporary_target=Cannot add temporart Target to manager.
|
||||||
MakeTargetManager.target_exists=Target exists
|
MakeTargetManager.target_exists=Target exists
|
||||||
MakeTargetManager.failed_initializing_targets=Failed initializing build targets
|
MakeTargetManager.failed_initializing_targets=Failed initializing make targets
|
||||||
MakeTargetManager.error_writing_file=Error writing target file
|
MakeTargetManager.error_writing_file=Error writing target file
|
||||||
|
|
||||||
ProjectTargets.error_reading_project_targets=Error reading project targets.
|
ProjectTargets.error_reading_project_targets=Error reading project targets.
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/*
|
/*******************************************************************************
|
||||||
* Created on 19-Aug-2003
|
* Created on 19-Aug-2003
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002,2003 QNX Software Systems Ltd.
|
* Copyright (c) 2002,2003 QNX Software Systems Ltd.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors: QNX Software Systems - Initial API and implementation
|
||||||
* QNX Software Systems - Initial API and implementation
|
******************************************************************************/
|
||||||
***********************************************************************/
|
|
||||||
package org.eclipse.cdt.make.internal.core;
|
package org.eclipse.cdt.make.internal.core;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -13,13 +12,17 @@ import java.util.HashMap;
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
|
import org.eclipse.core.resources.ICommand;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||||
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
|
|
||||||
public class MakeTarget implements IMakeTarget {
|
public class MakeTarget implements IMakeTarget {
|
||||||
|
|
||||||
|
@ -30,6 +33,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
private IPath buildCommand;
|
private IPath buildCommand;
|
||||||
private boolean isDefaultBuildCmd;
|
private boolean isDefaultBuildCmd;
|
||||||
private boolean isStopOnError;
|
private boolean isStopOnError;
|
||||||
|
private boolean runAllBuidlers = true;
|
||||||
private String targetBuilderID;
|
private String targetBuilderID;
|
||||||
private IContainer container;
|
private IContainer container;
|
||||||
|
|
||||||
|
@ -79,7 +83,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getBuildCommand() {
|
public IPath getBuildCommand() {
|
||||||
return buildCommand != null ? buildCommand: new Path(""); //$NON-NLS-1$
|
return buildCommand != null ? buildCommand : new Path(""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBuildCommand(IPath command) throws CoreException {
|
public void setBuildCommand(IPath command) throws CoreException {
|
||||||
|
@ -104,7 +108,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
if (obj == this)
|
if (obj == this)
|
||||||
return true;
|
return true;
|
||||||
if (obj instanceof MakeTarget) {
|
if (obj instanceof MakeTarget) {
|
||||||
MakeTarget other = (MakeTarget) obj;
|
MakeTarget other = (MakeTarget)obj;
|
||||||
return container.equals(other.getContainer()) && name.equals(other.getName());
|
return container.equals(other.getContainer()) && name.equals(other.getName());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -115,26 +119,56 @@ public class MakeTarget implements IMakeTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void build(IProgressMonitor monitor) throws CoreException {
|
public void build(IProgressMonitor monitor) throws CoreException {
|
||||||
IProject project = container.getProject();
|
final IProject project = container.getProject();
|
||||||
String builderID = manager.getBuilderID(targetBuilderID);
|
final String builderID = manager.getBuilderID(targetBuilderID);
|
||||||
HashMap infoMap = new HashMap();
|
final HashMap infoMap = new HashMap();
|
||||||
|
|
||||||
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(infoMap, builderID);
|
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(infoMap, builderID);
|
||||||
if ( buildArguments != null) {
|
if (buildArguments != null) {
|
||||||
info.setBuildArguments(buildArguments);
|
info.setBuildArguments(buildArguments);
|
||||||
}
|
}
|
||||||
if ( buildCommand != null ) {
|
if (buildCommand != null) {
|
||||||
info.setBuildCommand(buildCommand);
|
info.setBuildCommand(buildCommand);
|
||||||
}
|
}
|
||||||
info.setUseDefaultBuildCmd(isDefaultBuildCmd);
|
info.setUseDefaultBuildCmd(isDefaultBuildCmd);
|
||||||
info.setStopOnError(isStopOnError);
|
info.setStopOnError(isStopOnError);
|
||||||
info.setFullBuildEnable(true);
|
info.setFullBuildEnable(true);
|
||||||
info.setFullBuildTarget(target);
|
info.setFullBuildTarget(target);
|
||||||
if ( container != null) {
|
if (container != null) {
|
||||||
info.setBuildLocation(container.getFullPath());
|
info.setBuildLocation(container.getFullPath());
|
||||||
}
|
}
|
||||||
IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(project, builderID);
|
IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(project, builderID);
|
||||||
info.setErrorParsers(projectInfo.getErrorParsers());
|
info.setErrorParsers(projectInfo.getErrorParsers());
|
||||||
project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor);
|
IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||||
|
*/
|
||||||
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
|
if (runAllBuidlers) {
|
||||||
|
ICommand[] commands = project.getDescription().getBuildSpec();
|
||||||
|
monitor.beginTask("", commands.length); //$NON-NLS-1$
|
||||||
|
for (int i = 0; i < commands.length; i++) {
|
||||||
|
if (commands[i].getBuilderName().equals(builderID)) {
|
||||||
|
project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor);
|
||||||
|
} else {
|
||||||
|
project.build(IncrementalProjectBuilder.FULL_BUILD, commands[i].getBuilderName(),
|
||||||
|
commands[i].getArguments(), new SubProgressMonitor(monitor, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
monitor.done();
|
||||||
|
} else {
|
||||||
|
project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
ResourcesPlugin.getWorkspace().run(op, monitor);
|
||||||
|
} finally {
|
||||||
|
monitor.done();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBuildTarget(String target) throws CoreException {
|
public void setBuildTarget(String target) throws CoreException {
|
||||||
|
@ -145,4 +179,22 @@ public class MakeTarget implements IMakeTarget {
|
||||||
public String getBuildTarget() {
|
public String getBuildTarget() {
|
||||||
return target != null ? target : ""; //$NON-NLS-1$
|
return target != null ? target : ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.make.core.IMakeTarget#setRunAllBuilders(boolean)
|
||||||
|
*/
|
||||||
|
public void setRunAllBuilders(boolean runAllBuilders) {
|
||||||
|
this.runAllBuidlers = runAllBuilders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.make.core.IMakeTarget#runAllBuilders()
|
||||||
|
*/
|
||||||
|
public boolean runAllBuilders() {
|
||||||
|
return runAllBuidlers;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -32,6 +32,7 @@ SettingsBlock.label=Make Builder
|
||||||
SettingsBlock.message=Make builder settings.
|
SettingsBlock.message=Make builder settings.
|
||||||
SettingsBlock.makeSetting.group_label=Build Setting
|
SettingsBlock.makeSetting.group_label=Build Setting
|
||||||
SettingsBlock.makeSetting.stopOnError=Stop on first build error.
|
SettingsBlock.makeSetting.stopOnError=Stop on first build error.
|
||||||
|
SettingsBlock.makeSetting.runAllBuilders=Run all project builders.
|
||||||
SettingsBlock.makeCmd.group_label=Build command
|
SettingsBlock.makeCmd.group_label=Build command
|
||||||
SettingsBlock.makeCmd.use_default=Use default
|
SettingsBlock.makeCmd.use_default=Use default
|
||||||
SettingsBlock.makeCmd.label=Build command:
|
SettingsBlock.makeCmd.label=Build command:
|
||||||
|
@ -49,8 +50,8 @@ SettingsBlock.makeWorkbench.clean=Clean
|
||||||
TargetBlock.target.group_label=Target
|
TargetBlock.target.group_label=Target
|
||||||
TargetBlock.target.label=Target Name:
|
TargetBlock.target.label=Target Name:
|
||||||
|
|
||||||
BuildTarget.target.group_label=Build Target
|
BuildTarget.target.group_label=Make Target
|
||||||
BuildTarget.target.label=Build Target:
|
BuildTarget.target.label=Make Target:
|
||||||
|
|
||||||
|
|
||||||
# String constants for the build include path and preprocessor symbols
|
# String constants for the build include path and preprocessor symbols
|
||||||
|
@ -84,9 +85,9 @@ MakeTargetsPreferencePage.buildTargetInBackground.label=Build make targets in ba
|
||||||
|
|
||||||
MakeDocumentProvider.exception.createElementInfo=Error creating element.
|
MakeDocumentProvider.exception.createElementInfo=Error creating element.
|
||||||
|
|
||||||
AddBuildTargetAction.title=Add To Build Target
|
AddBuildTargetAction.title=Add make Target
|
||||||
AddBuildTargetAction.description=Add To Build Target
|
AddBuildTargetAction.description=Add make Target
|
||||||
AddBuildTargetAction.tooltip= Add To Build Target
|
AddBuildTargetAction.tooltip= Add make Target
|
||||||
AddBuildTargetAction.exception.internal=Internal Error
|
AddBuildTargetAction.exception.internal=Internal Error
|
||||||
|
|
||||||
TargetBuild.execption.message=Target Build Error
|
TargetBuild.execption.message=Target Build Error
|
||||||
|
@ -110,7 +111,7 @@ BuildPathInfoBlock.button.browse=Browse...
|
||||||
BuildPathInfoBlock.description=Set the include paths and preprocessor symbols for this project
|
BuildPathInfoBlock.description=Set the include paths and preprocessor symbols for this project
|
||||||
BuildPathInfoBlock.monitor.settingScannerInfo=Setting Scanner Info
|
BuildPathInfoBlock.monitor.settingScannerInfo=Setting Scanner Info
|
||||||
|
|
||||||
BuildTargetDialog.title.buildTarget=Build Targets
|
BuildTargetDialog.title.buildTarget=Make Targets
|
||||||
BuildTargetDialog.button.build=Build
|
BuildTargetDialog.button.build=Build
|
||||||
BuildTargetDialog.title.makeTargetsFor=Make Targets for:
|
BuildTargetDialog.title.makeTargetsFor=Make Targets for:
|
||||||
|
|
||||||
|
@ -130,25 +131,25 @@ SettingsBlock.label.missingBuilderInformation=Missing builder information on pro
|
||||||
SettingsBlock.monitor.applyingSettings=Applying Settings...
|
SettingsBlock.monitor.applyingSettings=Applying Settings...
|
||||||
SettingsBlock.message.mustEnterBuildCommand=Must enter a build command
|
SettingsBlock.message.mustEnterBuildCommand=Must enter a build command
|
||||||
|
|
||||||
DeleteTargetAction.label=Delete Build Target
|
DeleteTargetAction.label=Delete Make Target
|
||||||
DeleteTargetAction.tooltip=Delete Build Target
|
DeleteTargetAction.tooltip=Delete Make Target
|
||||||
DeleteTargetAction.title.confirmDeletion=Confirm Target Deletion
|
DeleteTargetAction.title.confirmDeletion=Confirm Target Deletion
|
||||||
DeleteTargetAction.message.confirmDeleteion=Are you sure you want to delete ''{0}''?
|
DeleteTargetAction.message.confirmDeleteion=Are you sure you want to delete ''{0}''?
|
||||||
DeleteTargetAction.title.confirmMultipleDeletion=Confirm Multiple Target Deletion
|
DeleteTargetAction.title.confirmMultipleDeletion=Confirm Multiple Target Deletion
|
||||||
DeleteTargetAction.message.confirmMultipleDeletion=Are you sure you want to delete these {0} targets?
|
DeleteTargetAction.message.confirmMultipleDeletion=Are you sure you want to delete these {0} targets?
|
||||||
DeleteTargetAction.exception.removeError=Target Remove Error
|
DeleteTargetAction.exception.removeError=Make Target Remove Error
|
||||||
DeleteTargetAction.exception.errorDeletingBuildTarget=Error deleting build target
|
DeleteTargetAction.exception.errorDeletingBuildTarget=Error deleting Make target
|
||||||
|
|
||||||
BuildTargetAction.label=Build Target
|
BuildTargetAction.label=Build Make Target
|
||||||
BuildTargetAction.tooltip=Build Target
|
BuildTargetAction.tooltip=Build Make Target
|
||||||
|
|
||||||
EditTargetAction.label=Edit Build Target
|
EditTargetAction.label=Edit Make Target
|
||||||
EditTargetAction.tooltip=Edit Build Target
|
EditTargetAction.tooltip=Edit Make Target
|
||||||
EditTargetAction.exception.internalError=Internal Error
|
EditTargetAction.exception.internalError=Internal Error
|
||||||
EditTargetAction.exception.errorEditingTarget=Error editing target.
|
EditTargetAction.exception.errorEditingTarget=Error editing target.
|
||||||
|
|
||||||
AddTargetAction.label=Add Build Target
|
AddTargetAction.label=Add Make Target
|
||||||
AddTargetAction.tooltip=Add Build Target
|
AddTargetAction.tooltip=Add Make Target
|
||||||
AddTargetAction.exception.internalError=Internal Error
|
AddTargetAction.exception.internalError=Internal Error
|
||||||
AddTargetAction.=Internal Error
|
AddTargetAction.=Internal Error
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
|
|
||||||
Text targetNameText;
|
Text targetNameText;
|
||||||
Button stopOnErrorButton;
|
Button stopOnErrorButton;
|
||||||
|
Button runAllBuildersButton;
|
||||||
Text commandText;
|
Text commandText;
|
||||||
Button defButton;
|
Button defButton;
|
||||||
Text targetText;
|
Text targetText;
|
||||||
|
@ -68,6 +69,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
private IPath buildCommand;
|
private IPath buildCommand;
|
||||||
private boolean isDefaultCommand;
|
private boolean isDefaultCommand;
|
||||||
private boolean isStopOnError;
|
private boolean isStopOnError;
|
||||||
|
private boolean runAllBuilders = true;
|
||||||
private String buildArguments;
|
private String buildArguments;
|
||||||
private String targetString;
|
private String targetString;
|
||||||
private String targetName;
|
private String targetName;
|
||||||
|
@ -87,6 +89,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
targetName = target.getName();
|
targetName = target.getName();
|
||||||
targetString = target.getBuildTarget();
|
targetString = target.getBuildTarget();
|
||||||
targetBuildID = target.getTargetBuilderID();
|
targetBuildID = target.getTargetBuilderID();
|
||||||
|
runAllBuilders = target.runAllBuilders();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,12 +101,12 @@ public class MakeTargetDialog extends Dialog {
|
||||||
fTargetManager = MakeCorePlugin.getDefault().getTargetManager();
|
fTargetManager = MakeCorePlugin.getDefault().getTargetManager();
|
||||||
String[] id = fTargetManager.getTargetBuilders(container.getProject());
|
String[] id = fTargetManager.getTargetBuilders(container.getProject());
|
||||||
if (id.length == 0) {
|
if (id.length == 0) {
|
||||||
throw new CoreException(
|
throw new CoreException(new Status(IStatus.ERROR, MakeUIPlugin.getUniqueIdentifier(), -1,
|
||||||
new Status(IStatus.ERROR, MakeUIPlugin.getUniqueIdentifier(), -1, MakeUIPlugin.getResourceString("MakeTargetDialog.exception.noTargetBuilderOnProject"), null)); //$NON-NLS-1$
|
MakeUIPlugin.getResourceString("MakeTargetDialog.exception.noTargetBuilderOnProject"), null)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
targetBuildID = id[0];
|
targetBuildID = id[0];
|
||||||
IMakeBuilderInfo buildInfo =
|
IMakeBuilderInfo buildInfo = MakeCorePlugin.createBuildInfo(container.getProject(),
|
||||||
MakeCorePlugin.createBuildInfo(container.getProject(), fTargetManager.getBuilderID(targetBuildID));
|
fTargetManager.getBuilderID(targetBuildID));
|
||||||
isStopOnError = buildInfo.isStopOnError();
|
isStopOnError = buildInfo.isStopOnError();
|
||||||
isDefaultCommand = buildInfo.isDefaultBuildCmd();
|
isDefaultCommand = buildInfo.isDefaultBuildCmd();
|
||||||
buildCommand = buildInfo.getBuildCommand();
|
buildCommand = buildInfo.getBuildCommand();
|
||||||
|
@ -134,25 +137,23 @@ public class MakeTargetDialog extends Dialog {
|
||||||
Composite composite = (Composite)super.createDialogArea(parent);
|
Composite composite = (Composite)super.createDialogArea(parent);
|
||||||
initializeDialogUnits(composite);
|
initializeDialogUnits(composite);
|
||||||
|
|
||||||
|
createNameControl(composite);
|
||||||
|
createTargetControl(composite);
|
||||||
|
createBuildCmdControls(composite);
|
||||||
|
createSettingControls(composite);
|
||||||
|
|
||||||
fStatusLine = new MessageLine(composite);
|
fStatusLine = new MessageLine(composite);
|
||||||
fStatusLine.setAlignment(SWT.LEFT);
|
fStatusLine.setAlignment(SWT.LEFT);
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
gd.widthHint = convertWidthInCharsToPixels(50);
|
gd.widthHint = convertWidthInCharsToPixels(50);
|
||||||
fStatusLine.setLayoutData(gd);
|
fStatusLine.setLayoutData(gd);
|
||||||
fStatusLine.setMessage(getTitle());
|
|
||||||
|
|
||||||
createNameControl(composite);
|
|
||||||
createTargetControl(composite);
|
|
||||||
createBuildCmdControls(composite);
|
|
||||||
createSettingControls(composite);
|
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createNameControl(Composite parent) {
|
protected void createNameControl(Composite parent) {
|
||||||
Composite composite = ControlFactory.createComposite(parent, 2);
|
Composite composite = ControlFactory.createComposite(parent, 2);
|
||||||
((GridLayout)composite.getLayout()).makeColumnsEqualWidth = false;
|
((GridLayout)composite.getLayout()).makeColumnsEqualWidth = false;
|
||||||
((GridLayout)composite.getLayout()).horizontalSpacing = 0;
|
|
||||||
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
Label label = ControlFactory.createLabel(composite, MakeUIPlugin.getResourceString(TARGET_NAME_LABEL));
|
Label label = ControlFactory.createLabel(composite, MakeUIPlugin.getResourceString(TARGET_NAME_LABEL));
|
||||||
((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
|
((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
|
||||||
|
@ -161,6 +162,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
((GridData) (targetNameText.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (targetNameText.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (targetNameText.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (targetNameText.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
targetNameText.addListener(SWT.Modify, new Listener() {
|
targetNameText.addListener(SWT.Modify, new Listener() {
|
||||||
|
|
||||||
public void handleEvent(Event e) {
|
public void handleEvent(Event e) {
|
||||||
String newName = targetNameText.getText().trim();
|
String newName = targetNameText.getText().trim();
|
||||||
if (newName.equals("")) { //$NON-NLS-1$
|
if (newName.equals("")) { //$NON-NLS-1$
|
||||||
|
@ -168,9 +170,8 @@ public class MakeTargetDialog extends Dialog {
|
||||||
getButton(IDialogConstants.OK_ID).setEnabled(false);
|
getButton(IDialogConstants.OK_ID).setEnabled(false);
|
||||||
} else
|
} else
|
||||||
try {
|
try {
|
||||||
if (fTarget != null
|
if (fTarget != null && fTarget.getName().equals(newName)
|
||||||
&& fTarget.getName().equals(newName)
|
|| fTargetManager.findTarget(fContainer, newName) == null) {
|
||||||
|| fTargetManager.findTarget(fContainer, newName) == null) {
|
|
||||||
fStatusLine.setErrorMessage(null);
|
fStatusLine.setErrorMessage(null);
|
||||||
getButton(IDialogConstants.OK_ID).setEnabled(true);
|
getButton(IDialogConstants.OK_ID).setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -197,18 +198,23 @@ public class MakeTargetDialog extends Dialog {
|
||||||
} else {
|
} else {
|
||||||
stopOnErrorButton.setEnabled(false);
|
stopOnErrorButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
runAllBuildersButton = new Button(group, SWT.CHECK);
|
||||||
|
runAllBuildersButton.setText(MakeUIPlugin.getResourceString("SettingsBlock.makeSetting.runAllBuilders")); //$NON-NLS-1$
|
||||||
|
if (runAllBuilders) {
|
||||||
|
runAllBuildersButton.setSelection(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createBuildCmdControls(Composite parent) {
|
protected void createBuildCmdControls(Composite parent) {
|
||||||
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1);
|
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
layout.horizontalSpacing = 0;
|
|
||||||
layout.makeColumnsEqualWidth = false;
|
layout.makeColumnsEqualWidth = false;
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT));
|
defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT));
|
||||||
defButton.addSelectionListener(new SelectionAdapter() {
|
defButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (defButton.getSelection() == true) {
|
if (defButton.getSelection() == true) {
|
||||||
commandText.setEnabled(false);
|
commandText.setEnabled(false);
|
||||||
|
@ -229,6 +235,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
((GridData) (commandText.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (commandText.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (commandText.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (commandText.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
commandText.addListener(SWT.Modify, new Listener() {
|
commandText.addListener(SWT.Modify, new Listener() {
|
||||||
|
|
||||||
public void handleEvent(Event e) {
|
public void handleEvent(Event e) {
|
||||||
if (commandText.getText().equals("")) { //$NON-NLS-1$
|
if (commandText.getText().equals("")) { //$NON-NLS-1$
|
||||||
fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
|
fStatusLine.setErrorMessage(MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
|
||||||
|
@ -277,7 +284,8 @@ public class MakeTargetDialog extends Dialog {
|
||||||
createButton(parent, IDialogConstants.OK_ID, MakeUIPlugin.getResourceString("MakeTargetDialog.button.create"), true); //$NON-NLS-1$
|
createButton(parent, IDialogConstants.OK_ID, MakeUIPlugin.getResourceString("MakeTargetDialog.button.create"), true); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||||
//do this here because setting the text will set enablement on the ok button
|
//do this here because setting the text will set enablement on the ok
|
||||||
|
// button
|
||||||
targetNameText.setFocus();
|
targetNameText.setFocus();
|
||||||
if (targetName != null) {
|
if (targetName != null) {
|
||||||
targetNameText.setText(targetName);
|
targetNameText.setText(targetName);
|
||||||
|
@ -304,6 +312,10 @@ public class MakeTargetDialog extends Dialog {
|
||||||
return stopOnErrorButton.getSelection();
|
return stopOnErrorButton.getSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean runAllBuilders() {
|
||||||
|
return runAllBuildersButton.getSelection();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean useDefaultBuildCmd() {
|
private boolean useDefaultBuildCmd() {
|
||||||
return defButton.getSelection();
|
return defButton.getSelection();
|
||||||
}
|
}
|
||||||
|
@ -323,8 +335,8 @@ public class MakeTargetDialog extends Dialog {
|
||||||
if (fTarget == null) {
|
if (fTarget == null) {
|
||||||
target = fTargetManager.createTarget(fContainer.getProject(), targetNameText.getText().trim(), targetBuildID);
|
target = fTargetManager.createTarget(fContainer.getProject(), targetNameText.getText().trim(), targetBuildID);
|
||||||
}
|
}
|
||||||
|
|
||||||
target.setStopOnError(isStopOnError());
|
target.setStopOnError(isStopOnError());
|
||||||
|
target.setRunAllBuilders(runAllBuilders());
|
||||||
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
||||||
if (!useDefaultBuildCmd()) {
|
if (!useDefaultBuildCmd()) {
|
||||||
String bldLine = getBuildLine();
|
String bldLine = getBuildLine();
|
||||||
|
@ -359,7 +371,9 @@ public class MakeTargetDialog extends Dialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
MakeUIPlugin.errorDialog(getShell(), MakeUIPlugin.getResourceString("MakeTargetDialog.exception.makeTargetError"), MakeUIPlugin.getResourceString("MakeTargetDialog.exception.errorAddingTarget"), e); //$NON-NLS-1$ //$NON-NLS-2$
|
MakeUIPlugin.errorDialog(
|
||||||
|
getShell(),
|
||||||
|
MakeUIPlugin.getResourceString("MakeTargetDialog.exception.makeTargetError"), MakeUIPlugin.getResourceString("MakeTargetDialog.exception.errorAddingTarget"), e); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
super.okPressed();
|
super.okPressed();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue