Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDavid Inglis2006-05-11 16:38:16 +0000
committerDavid Inglis2006-05-11 16:38:16 +0000
commit825bc6be8cd80f4722808ebe8f54c1bc224df2db (patch)
tree71c7bb228ea9609ee85d7b3d301fab8fd15e5ce9 /build
parent975237b92ae6b0cf6ea336dd38fe34de187ae851 (diff)
downloadorg.eclipse.cdt-825bc6be8cd80f4722808ebe8f54c1bc224df2db.tar.gz
org.eclipse.cdt-825bc6be8cd80f4722808ebe8f54c1bc224df2db.tar.xz
org.eclipse.cdt-825bc6be8cd80f4722808ebe8f54c1bc224df2db.zip
patch from Tianchao Li to fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=136136
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java6
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java28
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties3
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java32
4 files changed, 58 insertions, 11 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
index 574d6c2ee7a..d11fbab1535 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
@@ -140,9 +140,9 @@ public class MakeBuilder extends ACBuilder {
// remove all markers for this project
removeAllMarkers(currProject);
- IPath workingDirectory = null;
- if (!info.getBuildLocation().isEmpty()) {
- IResource res = currProject.getParent().findMember(info.getBuildLocation());
+ IPath workingDirectory = info.getBuildLocation();
+ if (workingDirectory != null && !workingDirectory.isEmpty()) {
+ IResource res = currProject.getParent().findMember(workingDirectory);
if (res instanceof IContainer && res.exists()) {
workingDirectory = res.getLocation();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
index 94246dd1d40..f46c7689b80 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
@@ -21,6 +21,8 @@ import org.eclipse.cdt.core.CommandLauncher;
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
+import org.eclipse.cdt.make.core.IMakeBuilderInfo;
+import org.eclipse.cdt.make.core.MakeBuilder;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
@@ -30,8 +32,10 @@ import org.eclipse.cdt.make.internal.core.StreamMonitor;
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -157,7 +161,29 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
* @return boolean
*/
protected boolean initialize() {
- fWorkingDirectory = resource.getProject().getLocation();
+
+ IProject currProject = resource.getProject();
+ IMakeBuilderInfo info;
+ try {
+ info = MakeCorePlugin.createBuildInfo(resource.getProject(), MakeBuilder.BUILDER_ID);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ IPath workingDirectory = info.getBuildLocation();
+ if (workingDirectory != null && !workingDirectory.isEmpty()) {
+ IResource res = currProject.getParent().findMember(workingDirectory);
+ if (res instanceof IContainer && res.exists()) {
+ workingDirectory = res.getLocation();
+ }
+ }
+ if (workingDirectory == null) {
+ workingDirectory = currProject.getLocation();
+ }
+
+ //fWorkingDirectory = resource.getProject().getLocation();
+ fWorkingDirectory = workingDirectory;
fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId));
fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(buildInfo.getProviderRunArguments(providerId), "\"");//$NON-NLS-1$
return (fCompileCommand != null);
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
index 1bfa76bd04a..2c86b13f2f6 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
@@ -68,7 +68,8 @@ SettingsBlock.makeCmd.use_default=Use default
SettingsBlock.makeCmd.label=Build command:
SettingsBlock.makeDir.group_label=Build Directory
SettingsBlock.makeDir.label=Build directory:
-SettingsBlock.makeDir.browse=Browse...
+SettingsBlock.makeDir.browseLocal=Local...
+SettingsBlock.makeDir.browseWorkspace=Workspace...
SettingsBlock.makeWorkbench.group_label=Workbench Build Behavior
SettingsBlock.makeWorkbench.type=Workbench build type:
SettingsBlock.makeWorkbench.target=Make build target:
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java
index cd3566e2d2f..0be7abb9665 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java
@@ -43,6 +43,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
@@ -72,8 +73,9 @@ public class SettingsBlock extends AbstractCOptionPage {
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_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$
- private static final String MAKE_BUILD_DIR_BROWSE = PREFIX + ".makeDir.browse"; //$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_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_INCREMENTAL_TARGET = PREFIX + ".makeWorkbench.incrementalBuildTarget"; //$NON-NLS-1$
@@ -314,7 +316,7 @@ public class SettingsBlock extends AbstractCOptionPage {
protected void createBuilderWorkingDirControls(Composite parent) {
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1);
GridLayout layout = new GridLayout();
- layout.numColumns = 4;
+ layout.numColumns = 5;
layout.makeColumnsEqualWidth = false;
group.setLayout(layout);
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -330,9 +332,27 @@ public class SettingsBlock extends AbstractCOptionPage {
getContainer().updateContainer();
}
});
- Button browse = new Button(group, SWT.NONE);
- browse.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE));
- browse.addSelectionListener(new SelectionAdapter() {
+
+ Button browseLocal = new Button(group, SWT.NONE);
+ browseLocal.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_LOCAL));
+ browseLocal.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);
+ }
+ }
+ }
+ });
+
+ Button browseWorkspace = new Button(group, SWT.NONE);
+ browseWorkspace.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE_WORKSPACE));
+ browseWorkspace.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), getContainer().getProject(), true,

Back to the top