Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-06-04 20:17:57 +0000
committerSean Evoy2004-06-04 20:17:57 +0000
commit5f5b6bc0d76595e4b92f22fb99ae2c6a05ae6e12 (patch)
tree6bd9dc441cbe88b070d3feee11fef631aa79a897 /build/org.eclipse.cdt.managedbuilder.ui/src
parenta9c11b6167779f2553ed7cf04a4f200ec69eef2e (diff)
downloadorg.eclipse.cdt-5f5b6bc0d76595e4b92f22fb99ae2c6a05ae6e12.tar.gz
org.eclipse.cdt-5f5b6bc0d76595e4b92f22fb99ae2c6a05ae6e12.tar.xz
org.eclipse.cdt-5f5b6bc0d76595e4b92f22fb99ae2c6a05ae6e12.zip
Fix fog bug 64952 -- Indexer being called when it doesn't need to run
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ErrorParserBlock.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderPropertyPage.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java50
6 files changed, 32 insertions, 29 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ErrorParserBlock.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ErrorParserBlock.java
index 319b10b349..58008294ad 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ErrorParserBlock.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ErrorParserBlock.java
@@ -48,7 +48,7 @@ public class ErrorParserBlock extends AbstractErrorParserBlock {
// page before the "C/C++ Build" page.
// Get the build information
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, true);
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
target = info.getDefaultTarget();
}
if (target != null) {
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java
index 1a3ee7eac3..36c85e1aa7 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java
@@ -31,7 +31,7 @@ public class ManagedBuilderUIImages {
// Subdirectory (under the package containing this class) where 16 color images are
private static URL iconBaseURL = null;
static {
- iconBaseURL = Platform.getBundle(ManagedBuilderUIPlugin.getUniqueIdentifier()).getEntry("icons/");
+ iconBaseURL = Platform.getBundle(ManagedBuilderUIPlugin.getUniqueIdentifier()).getEntry("icons/"); //$NON-NLS-1$
}
private static final String NAME_PREFIX= ManagedBuilderUIPlugin.getUniqueIdentifier() + '.';
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
index e4f2bbed0a..89a22839bb 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
@@ -173,7 +173,7 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
GridData gd;
// Initialize the key data
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject(), true);
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
if (info.getVersion() == null) {
// Display a message page instead of the properties control
final Label invalidInfo = new Label(composite, SWT.LEFT);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderPropertyPage.java
index 518aaf9dc3..1e7a5a6b83 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderPropertyPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderPropertyPage.java
@@ -141,7 +141,7 @@ public class ManagedBuilderPropertyPage extends PropertyPage implements ICOption
IProject project = getProject();
ITarget target = ManagedBuildManager.getSelectedTarget(project);
if (target == null) {
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, true);
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
target = info.getDefaultTarget();
ManagedBuildManager.setSelectedTarget(project, target);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java
index 3ee8c744dd..f8ad8e0091 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java
@@ -28,6 +28,9 @@ public class NewManagedCProjectWizard extends NewManagedProjectWizard {
super(title, description);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
public void addPages() {
// Add the default page for all new managed projects
super.addPages();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
index 9d028a934b..5a6591f306 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
@@ -21,9 +21,11 @@ import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
+import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
@@ -89,27 +91,34 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
// super.doRun() just creates the project and does not assign a builder to it.
super.doRun(new SubProgressMonitor(monitor, 5));
- // Add the managed build nature
+ // Add the managed build nature and builder
+ ICDescriptor desc = null;
try {
monitor.subTask(ManagedBuilderUIMessages.getResourceString(MSG_ADD_NATURE));
ManagedCProjectNature.addManagedNature(newProject, new SubProgressMonitor(monitor, 1));
- } catch (CoreException e) {
- // Bail out of the project creation
- }
- // Add the builder
- try {
monitor.subTask(ManagedBuilderUIMessages.getResourceString(MSG_ADD_BUILDER));
ManagedCProjectNature.addManagedBuilder(newProject, new SubProgressMonitor(monitor, 1));
+ desc = CCorePlugin.getDefault().getCProjectDescription(newProject);
+ desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+ desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
+ desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
} catch (CoreException e) {
- // Bail out of the project creation
+ ManagedBuilderUIPlugin.log(e);
}
-
+
// Add the target to the project
ITarget newTarget = null;
try {
+ ManagedBuildManager.createBuildInfo(newProject);
ITarget parent = targetConfigurationPage.getSelectedTarget();
newTarget = ManagedBuildManager.createTarget(newProject, parent);
if (newTarget != null) {
+ try {
+ // org.eclipse.cdt.core.ELF or org.eclipse.cdt.core.PE
+ desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, newTarget.getBinaryParserId());
+ } catch (CoreException e) {
+ ManagedBuilderUIPlugin.log(e);
+ }
String artifactName = newProject.getName();
newTarget.setArtifactName(artifactName);
IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations();
@@ -132,27 +141,14 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
ManagedBuildManager.setNewProjectVersion(newProject);
}
} catch (BuildException e) {
- // TODO Flag the error to the user
+ ManagedBuilderUIPlugin.log(e);
}
- // Associate the project with the managed builder so the clients can get proper information
- try {
- ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(newProject);
- desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
- desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
-
- desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
- // org.eclipse.cdt.core.ELF or org.eclipse.cdt.core.PE
- desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, newTarget.getBinaryParserId());
- } catch (CoreException e) {
- // TODO Flag the error to the user
- }
-
// Modify the project settings
if (newProject != null) {
optionPage.performApply(new SubProgressMonitor(monitor, 2));
}
-
+
// Save the build options
monitor.subTask(ManagedBuilderUIMessages.getResourceString(MSG_SAVE));
ManagedBuildManager.saveBuildInfo(newProject, true);
@@ -171,8 +167,12 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
* @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunEpilogue(org.eclipse.core.runtime.IProgressMonitor)
*/
protected void doRunEpilogue(IProgressMonitor monitor) {
- // Auto-generated method stub
-
+ // Get my initializer to run
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(newProject);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ ManagedBuilderUIPlugin.log(initResult);
+ }
}
/* (non-Javadoc)

Back to the top