mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05: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() {
|
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$
|
String result = getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
|
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
|
||||||
|
|
|
@ -411,10 +411,12 @@ public class MakeTargetDndUtil {
|
||||||
// IMakeCommonBuildInfo attributes
|
// IMakeCommonBuildInfo attributes
|
||||||
// Ignore IMakeCommonBuildInfo.BUILD_LOCATION in order not to pick
|
// Ignore IMakeCommonBuildInfo.BUILD_LOCATION in order not to pick
|
||||||
// location of another project (or another folder)
|
// location of another project (or another folder)
|
||||||
|
if (!source.isDefaultBuildCmd()){
|
||||||
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND,
|
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND,
|
||||||
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, DEFAULT_BUILD_COMMAND));
|
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, DEFAULT_BUILD_COMMAND));
|
||||||
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS,
|
destination.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS,
|
||||||
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, "")); //$NON-NLS-1$
|
source.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, "")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
destination.setStopOnError(source.isStopOnError());
|
destination.setStopOnError(source.isStopOnError());
|
||||||
destination.setUseDefaultBuildCmd(source.isDefaultBuildCmd());
|
destination.setUseDefaultBuildCmd(source.isDefaultBuildCmd());
|
||||||
destination.setEnvironment(source.getEnvironment());
|
destination.setEnvironment(source.getEnvironment());
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
|
|
||||||
private IPath buildCommand;
|
private IPath buildCommand;
|
||||||
private final String defaultBuildCommand;
|
private final String defaultBuildCommand;
|
||||||
|
private final String defaultBuildArguments;
|
||||||
private boolean isDefaultCommand;
|
private boolean isDefaultCommand;
|
||||||
private boolean isStopOnError;
|
private boolean isStopOnError;
|
||||||
private boolean runAllBuilders = true;
|
private boolean runAllBuilders = true;
|
||||||
|
@ -169,6 +170,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
buildCommand = buildInfo.getBuildCommand();
|
buildCommand = buildInfo.getBuildCommand();
|
||||||
defaultBuildCommand = buildCommand.toString();
|
defaultBuildCommand = buildCommand.toString();
|
||||||
buildArguments = buildInfo.getBuildArguments();
|
buildArguments = buildInfo.getBuildArguments();
|
||||||
|
defaultBuildArguments = buildArguments;
|
||||||
targetString = buildInfo.getIncrementalBuildTarget();
|
targetString = buildInfo.getIncrementalBuildTarget();
|
||||||
|
|
||||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||||
|
@ -279,7 +281,13 @@ public class MakeTargetDialog extends Dialog {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (defButton.getSelection() == true) {
|
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);
|
commandText.setEnabled(false);
|
||||||
stopOnErrorButton.setEnabled(true);
|
stopOnErrorButton.setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -384,13 +392,11 @@ public class MakeTargetDialog extends Dialog {
|
||||||
targetNameText.selectAll();
|
targetNameText.selectAll();
|
||||||
if (buildCommand != null) {
|
if (buildCommand != null) {
|
||||||
StringBuffer cmd = new StringBuffer(buildCommand.toOSString());
|
StringBuffer cmd = new StringBuffer(buildCommand.toOSString());
|
||||||
if (!isDefaultCommand) {
|
|
||||||
String args = buildArguments;
|
String args = buildArguments;
|
||||||
if (args != null && !args.equals("")) { //$NON-NLS-1$
|
if (args != null && !args.equals("")) { //$NON-NLS-1$
|
||||||
cmd.append(" "); //$NON-NLS-1$
|
cmd.append(" "); //$NON-NLS-1$
|
||||||
cmd.append(args);
|
cmd.append(args);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
commandText.setText(cmd.toString());
|
commandText.setText(cmd.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -504,6 +510,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
||||||
if (useDefaultBuildCmd()) {
|
if (useDefaultBuildCmd()) {
|
||||||
target.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
|
target.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
|
||||||
|
target.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, defaultBuildArguments);
|
||||||
} else {
|
} else {
|
||||||
String bldLine = getBuildLine();
|
String bldLine = getBuildLine();
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue