mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
patch from Tianchao Li to fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=136136
This commit is contained in:
parent
5faf360a12
commit
9db611cefe
3 changed files with 38 additions and 27 deletions
|
@ -142,13 +142,12 @@ public class MakeBuilder extends ACBuilder {
|
||||||
removeAllMarkers(currProject);
|
removeAllMarkers(currProject);
|
||||||
|
|
||||||
IPath workingDirectory = info.getBuildLocation();
|
IPath workingDirectory = info.getBuildLocation();
|
||||||
if (workingDirectory != null && !workingDirectory.isEmpty()) {
|
if (!workingDirectory.isEmpty()) {
|
||||||
IResource res = currProject.getParent().findMember(workingDirectory);
|
IResource res = currProject.getParent().findMember(workingDirectory);
|
||||||
if (res instanceof IContainer && res.exists()) {
|
if (res instanceof IContainer && res.exists()) {
|
||||||
workingDirectory = res.getLocation();
|
workingDirectory = res.getLocation();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (workingDirectory == null) {
|
|
||||||
workingDirectory = currProject.getLocation();
|
workingDirectory = currProject.getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,10 +67,10 @@ 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:
|
||||||
SettingsBlock.makeDir.group_label=Build Directory
|
SettingsBlock.makeLoc.group_label=Build Location
|
||||||
SettingsBlock.makeDir.label=Build directory:
|
SettingsBlock.makeDir.label=Build directory:
|
||||||
SettingsBlock.makeDir.browseLocal=Local...
|
|
||||||
SettingsBlock.makeDir.browseWorkspace=Workspace...
|
SettingsBlock.makeDir.browseWorkspace=Workspace...
|
||||||
|
SettingsBlock.makeDir.browseFilesystem=Filesystem...
|
||||||
SettingsBlock.makeWorkbench.group_label=Workbench Build Behavior
|
SettingsBlock.makeWorkbench.group_label=Workbench Build Behavior
|
||||||
SettingsBlock.makeWorkbench.type=Workbench build type:
|
SettingsBlock.makeWorkbench.type=Workbench build type:
|
||||||
SettingsBlock.makeWorkbench.target=Make build target:
|
SettingsBlock.makeWorkbench.target=Make build target:
|
||||||
|
|
|
@ -73,9 +73,9 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
private static final String MAKE_WORKBENCH_BUILD_FULL = PREFIX + ".makeWorkbench.full"; //$NON-NLS-1$
|
private static final String MAKE_WORKBENCH_BUILD_FULL = PREFIX + ".makeWorkbench.full"; //$NON-NLS-1$
|
||||||
private static final String MAKE_WORKBENCH_BUILD_CLEAN = PREFIX + ".makeWorkbench.clean"; //$NON-NLS-1$
|
private static final String MAKE_WORKBENCH_BUILD_CLEAN = PREFIX + ".makeWorkbench.clean"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String MAKE_BUILD_DIR_GROUP = PREFIX + ".makeDir.group_label"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_GROUP = PREFIX + ".makeLoc.group_label"; //$NON-NLS-1$
|
||||||
private static final String MAKE_BUILD_DIR_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$
|
||||||
private static final String MAKE_BUILD_DIR_BROWSE_LOCAL = PREFIX + ".makeDir.browseLocal"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_BROWSE_FILESYSTEM = PREFIX + ".makeDir.browseFilesystem"; //$NON-NLS-1$
|
||||||
private static final String MAKE_BUILD_DIR_BROWSE_WORKSPACE = PREFIX + ".makeDir.browseWorkspace"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_BROWSE_WORKSPACE = PREFIX + ".makeDir.browseWorkspace"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String MAKE_BUILD_AUTO_TARGET = PREFIX + ".makeWorkbench.autoBuildTarget"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_AUTO_TARGET = PREFIX + ".makeWorkbench.autoBuildTarget"; //$NON-NLS-1$
|
||||||
|
@ -317,7 +317,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
protected void createBuilderWorkingDirControls(Composite parent) {
|
protected void createBuilderWorkingDirControls(Composite parent) {
|
||||||
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1);
|
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = 5;
|
layout.numColumns = 2;
|
||||||
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));
|
||||||
|
@ -334,24 +334,18 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button browseLocal = new Button(group, SWT.NONE);
|
Composite buttons = ControlFactory.createComposite(group, 4);
|
||||||
browseLocal.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_LOCAL));
|
layout = new GridLayout(4, false);
|
||||||
browseLocal.addSelectionListener(new SelectionAdapter() {
|
layout.marginHeight = layout.marginWidth = 0;
|
||||||
|
buttons.setLayout(layout);
|
||||||
public void widgetSelected(SelectionEvent e) {
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
|
gd.horizontalSpan = 2;
|
||||||
dialog.setText(MakeUIPlugin.getResourceString("SettingsBlock.title.selectLocationToBuildFrom"));
|
buttons.setLayoutData(gd);
|
||||||
dialog.setFilterPath(getContainer().getProject().toString());
|
|
||||||
String directory = dialog.open();
|
Label emptyLabel = ControlFactory.createLabel(buttons, ""); //$NON-NLS-1$
|
||||||
if (directory != null) {
|
emptyLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
if (directory.trim().length() > 0) {
|
|
||||||
buildLocation.setText(directory);
|
Button browseWorkspace = new Button(buttons, SWT.NONE);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Button browseWorkspace = new Button(group, SWT.NONE);
|
|
||||||
browseWorkspace.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_WORKSPACE));
|
browseWorkspace.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_WORKSPACE));
|
||||||
browseWorkspace.addSelectionListener(new SelectionAdapter() {
|
browseWorkspace.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
|
@ -366,8 +360,26 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Button browseFilesystem = new Button(buttons, SWT.NONE);
|
||||||
|
browseFilesystem.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_FILESYSTEM));
|
||||||
|
browseFilesystem.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
|
||||||
|
dialog.setText(MakeUIPlugin.getResourceString("SettingsBlock.title.selectLocationToBuildFrom"));
|
||||||
|
dialog.setFilterPath(getContainer().getProject().toString());
|
||||||
|
String directory = dialog.open();
|
||||||
|
if (directory != null) {
|
||||||
|
if (directory.trim().length() > 0) {
|
||||||
|
buildLocation.setText(directory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
buildLocation.setText(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, "")); //$NON-NLS-1$
|
buildLocation.setText(fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, "")); //$NON-NLS-1$
|
||||||
locationVariablesButton = addVariablesButton(group, buildLocation);
|
locationVariablesButton = addVariablesButton(buttons, buildLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue