mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
bug 293704: Arguments of build command are lost in Create/Modify Dialogs when builder settings are used
Patch from Axel Mueller
This commit is contained in:
parent
c2678fecf6
commit
28ffaab1ff
3 changed files with 28 additions and 11 deletions
|
@ -127,6 +127,14 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
}
|
||||
|
||||
public String getBuildArguments() {
|
||||
if (isDefaultBuildCmd()) {
|
||||
IMakeBuilderInfo info;
|
||||
try {
|
||||
info = MakeCorePlugin.createBuildInfo(getProject(), manager.getBuilderID(targetBuilderID));
|
||||
return info.getBuildArguments();
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
String result = getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
|
||||
try {
|
||||
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
|
||||
|
|
|
@ -411,10 +411,12 @@ public class MakeTargetDndUtil {
|
|||
// IMakeCommonBuildInfo attributes
|
||||
// Ignore IMakeCommonBuildInfo.BUILD_LOCATION in order not to pick
|
||||
// location of another project (or another folder)
|
||||
if (!source.isDefaultBuildCmd()){
|
||||
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND,
|
||||
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, DEFAULT_BUILD_COMMAND));
|
||||
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS,
|
||||
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, "")); //$NON-NLS-1$
|
||||
}
|
||||
destination.setStopOnError(source.isStopOnError());
|
||||
destination.setUseDefaultBuildCmd(source.isDefaultBuildCmd());
|
||||
destination.setEnvironment(source.getEnvironment());
|
||||
|
|
|
@ -78,6 +78,7 @@ public class MakeTargetDialog extends Dialog {
|
|||
|
||||
private IPath buildCommand;
|
||||
private final String defaultBuildCommand;
|
||||
private final String defaultBuildArguments;
|
||||
private boolean isDefaultCommand;
|
||||
private boolean isStopOnError;
|
||||
private boolean runAllBuilders = true;
|
||||
|
@ -169,6 +170,7 @@ public class MakeTargetDialog extends Dialog {
|
|||
buildCommand = buildInfo.getBuildCommand();
|
||||
defaultBuildCommand = buildCommand.toString();
|
||||
buildArguments = buildInfo.getBuildArguments();
|
||||
defaultBuildArguments = buildArguments;
|
||||
targetString = buildInfo.getIncrementalBuildTarget();
|
||||
|
||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
|
@ -279,7 +281,13 @@ public class MakeTargetDialog extends Dialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (defButton.getSelection() == true) {
|
||||
commandText.setText(defaultBuildCommand);
|
||||
StringBuffer cmd = new StringBuffer(defaultBuildCommand);
|
||||
String args = defaultBuildArguments;
|
||||
if (args != null && !args.equals("")) { //$NON-NLS-1$
|
||||
cmd.append(" "); //$NON-NLS-1$
|
||||
cmd.append(args);
|
||||
}
|
||||
commandText.setText(cmd.toString());
|
||||
commandText.setEnabled(false);
|
||||
stopOnErrorButton.setEnabled(true);
|
||||
} else {
|
||||
|
@ -384,13 +392,11 @@ public class MakeTargetDialog extends Dialog {
|
|||
targetNameText.selectAll();
|
||||
if (buildCommand != null) {
|
||||
StringBuffer cmd = new StringBuffer(buildCommand.toOSString());
|
||||
if (!isDefaultCommand) {
|
||||
String args = buildArguments;
|
||||
if (args != null && !args.equals("")) { //$NON-NLS-1$
|
||||
cmd.append(" "); //$NON-NLS-1$
|
||||
cmd.append(args);
|
||||
}
|
||||
}
|
||||
commandText.setText(cmd.toString());
|
||||
}
|
||||
}
|
||||
|
@ -504,6 +510,7 @@ public class MakeTargetDialog extends Dialog {
|
|||
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
||||
if (useDefaultBuildCmd()) {
|
||||
target.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
|
||||
target.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, defaultBuildArguments);
|
||||
} else {
|
||||
String bldLine = getBuildLine();
|
||||
int start = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue