Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Updated Scanner Info Discovery Mechanism

Hi All,
This is an involved patch. I sent out a detailed explanation of the work 
yesterday on the dev list. I have included that information below. I have 
done a quick test on Solaris, and a detailed list of changes can be found 
in the change logs. I will likely have to replace the code in the new 
project wizards with a COwner that does the same work, but that's less 
important for now than unblocking the model information client.

In order to work through CExtensionPoint mechanism, I have to change the 
existing extension point entries for the Managed and Standard builders to 
the following (all future builders will have to conform to this as well):
   <extension
         id="ManagedBuildManager"
         point="org.eclipse.cdt.core.ScannerInfoProvider">
      <cextension>
         <run
 class="org.eclipse.cdt.core.build.managed.ManagedBuildManager">
         </run>
      </cextension>
   </extension>

   <extension
         id="StandardBuildManager"
         point="org.eclipse.cdt.core.ScannerInfoProvider">
      <cextension>
         <run
 class="org.eclipse.cdt.core.build.standard.StandardBuildManager">
         </run>
      </cextension>
   </extension>

As well, the ManagedBuildManager and StandardBuildManager must extend 
AbstractCExtension.

The new project wizards for managed and standard projects have to be 
modified to register the right class as the scanner info providers for the 
project. The example below shows the managed project wizard code, but the 
standard project wizard is similar.
try {
        ICDescriptor desc = 
CCorePlugin.getDefault().getCProjectDescription(project);
        desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
        desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, 
ManagedBuildManager.INTERFACE_IDENTITY);
} <snip>


Clients use a new method defined in CCorePlugin 

public IScannerInfoProvider getScannerInfoProvider(IProject project) {
        IScannerInfoProvider provider = null;
        if (project != null) {
                try {
                        ICDescriptor desc = (ICDescriptor) 
getCProjectDescription(project);
                        ICExtensionReference[] extensions = 
desc.get(BUILD_SCANNER_INFO_UNIQ_ID);
                        if (extensions.length > 0)
                                provider = (IScannerInfoProvider) 
extensions[0].createExtension();
                } catch (CoreException e) {
                }
        }
        return provider;
}

to get the information provider as shown in the updated JUnit test code 
below:
// Find the first IScannerInfoProvider that supplies build info for the 
project
IScannerInfoProvider provider = 
CCorePlugin.getDefault().getScannerInfoProvider(project);
assertNotNull(provider);

As is the case now, clients implement the IScannerInfoChangeListener 
interface and pass themselves to the provider in a subscription message. 
There is also a new method on the IScannerInfoProvider interface that 
allows the client to get information immediately as shown below:
IScannerInfo currentSettings = provider.getScannerInformation(project); 

The ManagedBuildManager::getScannerInfo(IResource) method will be 
deprecated, then removed before the end of this release cycle.


Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada
Index: .classpath
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/.classpath,v
retrieving revision 1.9
diff -u -r1.9 .classpath
--- .classpath	24 Jul 2003 14:15:07 -0000	1.9
+++ .classpath	13 Aug 2003 14:43:49 -0000
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+    <classpathentry kind="src" path="build/"/>
     <classpathentry kind="src" path="index/"/>
     <classpathentry kind="src" path="model/"/>
     <classpathentry kind="src" path="src/"/>
     <classpathentry kind="src" path="utils/"/>
-    <classpathentry kind="src" path="build"/>
-    <classpathentry kind="src" path="dom"/>
-    <classpathentry kind="src" path="parser"/>
+    <classpathentry kind="src" path="parser/"/>
+    <classpathentry kind="src" path="dom/"/>
+    <classpathentry kind="src" path="search/"/>
+    <classpathentry kind="src" path="dependency/"/>
     <classpathentry kind="src" path="/org.eclipse.core.resources"/>
     <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
     <classpathentry kind="src" path="/org.apache.xerces"/>
@@ -14,8 +16,6 @@
     <classpathentry kind="src" path="/org.eclipse.compare"/>
     <classpathentry kind="src" path="/org.eclipse.debug.core"/>
     <classpathentry kind="src" path="/org.eclipse.core.boot"/>
-    <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
-    <classpathentry kind="src" path="search"/>
-    <classpathentry kind="src" path="dependency"/>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
     <classpathentry kind="output" path="bin"/>
 </classpath>
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.123
diff -u -r1.123 ChangeLog
--- ChangeLog	12 Aug 2003 20:20:04 -0000	1.123
+++ ChangeLog	13 Aug 2003 14:43:50 -0000
@@ -1,3 +1,31 @@
+2003-08-13 Sean Evoy
+	The major change in the increment of work is the new discovery mechanism 
+	that clients will use to find the IScannerInfoProvider for a project. 
+	Rather than a simple extension point which requires the client to iterate 
+	over all registered providers, the CExtension feature will be used to 
+	register the provider at project creation time, and to find the provider 
+	at runtime. 
+	
+	Changed the plugin entries for the two builders currently described. The 
+	schema for the ScannerInfoProvider was removed, and the plugin description 
+	was converted to work with the CExtension feature.
+	* plugin.xml
+	* schema/ScannerInfoProvider.exsd (removed)
+
+	Added a method to find and create the provider described in the extension point. 
+	Used by clients at runtime to discover the provider.
+	* src/org/eclipse/cdt/core/CCorePlugin.java
+	
+	Changed the IScannerInfoProvider interface by removing the 'managesResource' 
+	method (no more iteration required) and adding a method so clients can get 
+	build information as soon as they get the provider and before they subscribe.
+	* parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java	
+	
+	Updated the two classes that implemet the interface and made them inherit from 
+	AbstractCExtension in order to be managed by the CExtension feature. 
+	* build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
+	* build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java
+
 2003-08-12 Hoda Amer
 	Moved CharOperations and Utils from internal.core.search to internal.core
 	Added CConventions class to validate class names
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/plugin.xml,v
retrieving revision 1.25
diff -u -r1.25 plugin.xml
--- plugin.xml	4 Jul 2003 18:36:45 -0000	1.25
+++ plugin.xml	13 Aug 2003 14:43:50 -0000
@@ -33,7 +33,7 @@
    <extension-point id="CBuildVariable" name="C/C++ Build Variable" schema="schema/CBuildVariable.exsd"/>
    <extension-point id="CToolType" name="C/C++ Tool Type" schema="schema/CToolType.exsd"/>
    <extension-point id="ManagedBuildInfo" name="Managed Build Tools" schema="schema/ManagedBuildTools.exsd"/>
-   <extension-point id="ScannerInfoProvider" name="Scanner Information Provider" schema="schema/ScannerInfoProvider.exsd"/>
+   <extension-point id="ScannerInfoProvider" name="Scanner Information Provider"/>
 
    <extension
          point="org.eclipse.cdt.core.CToolType">
@@ -281,19 +281,24 @@
       </ignore>
    </extension>
    <extension
-         id="org.eclipse.cdt.core.ScannerInfoProvider"
-         name="Scanner Information Provider"
+         id="ManagedBuildManager"
          point="org.eclipse.cdt.core.ScannerInfoProvider">
-      <provider
-            class="org.eclipse.cdt.core.build.managed.ManagedBuildManager"
-            id="org.eclipse.cdt.core.provider.managed">
-      </provider>
-      <provider
-      		class="org.eclipse.cdt.core.build.standard.StandardBuildManager"
-            id="org.eclipse.cdt.core.provider.standard">
-      </provider>
+      <cextension>
+         <run
+               class="org.eclipse.cdt.core.build.managed.ManagedBuildManager">
+         </run>
+      </cextension>
    </extension>
 
+   <extension
+         id="StandardBuildManager"
+         point="org.eclipse.cdt.core.ScannerInfoProvider">
+      <cextension>
+         <run
+               class="org.eclipse.cdt.core.build.standard.StandardBuildManager">
+         </run>
+      </cextension>
+   </extension>
     <extension id="task" name="%CTaskName" point="org.eclipse.core.resources.markers">
         <super type="org.eclipse.core.resources.taskmarker"/> 
         <persistent value="true"/>
Index: build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java,v
retrieving revision 1.12
diff -u -r1.12 ManagedBuildManager.java
--- build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java	25 Jul 2003 14:40:04 -0000	1.12
+++ build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java	13 Aug 2003 14:43:50 -0000
@@ -28,6 +28,7 @@
 import org.apache.xml.serialize.OutputFormat;
 import org.apache.xml.serialize.Serializer;
 import org.apache.xml.serialize.SerializerFactory;
+import org.eclipse.cdt.core.AbstractCExtension;
 import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.parser.*;
 import org.eclipse.cdt.internal.core.build.managed.ManagedBuildInfo;
@@ -48,13 +49,13 @@
  * This is the main entry point for getting at the build information
  * for the managed build system. 
  */
-public class ManagedBuildManager implements IScannerInfoProvider {
+public class ManagedBuildManager extends AbstractCExtension implements IScannerInfoProvider {
 
-	private static final QualifiedName buildInfoProperty
-		= new QualifiedName(CCorePlugin.PLUGIN_ID, "managedBuildInfo");
+	private static final QualifiedName buildInfoProperty = new QualifiedName(CCorePlugin.PLUGIN_ID, "managedBuildInfo");
 	private static final String ROOT_ELEM_NAME = "ManagedProjectBuildInfo";
 	private static final String FILE_NAME = ".cdtbuild";
 	private static final ITarget[] emptyTargets = new ITarget[0];
+	public static final String INTERFACE_IDENTITY = CCorePlugin.PLUGIN_ID + "." + "ManagedBuildManager";
 
 	// Targets defined by extensions (i.e., not associated with a resource)
 	private static boolean extensionTargetsLoaded = false;
@@ -450,10 +451,9 @@
 	 * Answers with an interface to the parse information that has been 
 	 * associated with the resource specified in the argument. 
 	 * 
-	 * NOTE: This method is not part of the registration interface. It has
-	 * been made public as a short-term workaround for the clients of the
-	 * scanner information until the redesign of the build information management
-	 * occurs.
+	 * @deprecated This method is not part of the registration interface. 
+	 * Clients of build information should now use getScannerInformation(IResource) 
+	 * for one-time information requests.
 	 * 
 	 * @param resource
 	 * @return
@@ -463,6 +463,13 @@
 	}
 
 	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource)
+	 */
+	public IScannerInfo getScannerInformation(IResource resource) {
+		return (IScannerInfo) getBuildInfo(resource, false);
+	}
+
+	/* (non-Javadoc)
 	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
 	 */
 	public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) {
@@ -488,41 +495,6 @@
 		}
 	}
 
-	// TODO Remove all of the IScannerInfoProvider interface methods when
-	// the discovery mechanism is solidified
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#managesResource(org.eclipse.core.resources.IResource)
-	 */
-	public boolean managesResource(IResource resource) {
-		// The managed build manager manages build information for the 
-		// resource IFF it it is a project and has a build file with the proper
-		// root element
-		IProject project = null;
-		if (resource instanceof IProject){
-			project = (IProject)resource;
-		} else if (resource instanceof IFile) {
-			project = ((IFile)resource).getProject();
-		} else {
-			return false;
-		}
-		IFile file = project.getFile(FILE_NAME);
-		if (file.exists()) {
-			try {
-				InputStream stream = file.getContents();
-				DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-				Document document = parser.parse(stream);
-				Node rootElement = document.getFirstChild();
-				if (rootElement.getNodeName().equals(ROOT_ELEM_NAME)) {
-					return true;
-				} 
-			} catch (Exception e) {
-				return false;
-			}
-		}
-		return false;
-	}
-
 	/* (non-Javadoc)
 	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
 	 */
@@ -544,6 +516,4 @@
 			map.put(project, list);
 		}
 	}
-
-
 }
Index: build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java,v
retrieving revision 1.4
diff -u -r1.4 StandardBuildManager.java
--- build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java	16 Jul 2003 20:57:09 -0000	1.4
+++ build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java	13 Aug 2003 14:43:51 -0000
@@ -7,6 +7,7 @@
 import java.util.ListIterator;
 import java.util.Map;
 
+import org.eclipse.cdt.core.AbstractCExtension;
 import org.eclipse.cdt.core.BuildInfoFactory;
 import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.ICDescriptor;
@@ -21,7 +22,6 @@
 import org.eclipse.core.runtime.QualifiedName;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 /**********************************************************************
  * Copyright (c) 2002,2003 Rational Software Corporation and others.
@@ -34,11 +34,13 @@
  * IBM Rational Software - Initial API and implementation
 ***********************************************************************/
 
-public class StandardBuildManager implements IScannerInfoProvider {
+public class StandardBuildManager extends AbstractCExtension  implements IScannerInfoProvider {
 	// Name we will use to store build property with the project
 	private static final QualifiedName buildInfoProperty
 		= new QualifiedName(CCorePlugin.PLUGIN_ID, "standardBuildInfo");
 	private static final String ID = CCorePlugin.PLUGIN_ID + ".standardBuildInfo";
+	// This is the id of the IScannerInfoProvider extension point entry
+	public static final String INTERFACE_IDENTITY = CCorePlugin.PLUGIN_ID + "." + "StandardBuildManager";
 
 	// Listeners interested in build model changes
 	private static Map buildModelListeners; 
@@ -91,30 +93,6 @@
 		return buildModelListeners;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#managesResource(org.eclipse.core.resources.IResource)
-	 */
-	public boolean managesResource(IResource resource) throws CoreException {
-		/* 
-		 * Answers true if this project has a build info associated with it
-		 */
-		
-		IProject project = null;
-		if (resource instanceof IProject) {
-			project = (IProject)resource;
-		} else if (resource instanceof IFile) {
-			project = ((IFile)resource).getProject();
-		} else {
-			return false;
-		}
-
-		// Look for (but do not create) the build information
-		IStandardBuildInfo info = getBuildInfo(project);
-		
-		// If there's info, I manage the resource
-		return info == null ? false : true;
-	}
-
 	public static void setPreprocessorSymbols(IProject project, String[] symbols)
 		throws CoreException 
 	{
@@ -162,6 +140,19 @@
 		
 	}
 
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource)
+	 */
+	public IScannerInfo getScannerInformation(IResource resource) {
+		IStandardBuildInfo info;
+		try {
+			info = getBuildInfo((IProject)resource);
+		} catch (CoreException e) {
+			return null;
+		}
+		return (IScannerInfo)info;
+	}
+
 	/*
 	 * Loads the build file and parses the nodes for build information. The
 	 * information is then associated with the resource for the duration of 
@@ -266,4 +257,5 @@
 			map.put(project, list);
 		}
 	}
+
 }
Index: parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java,v
retrieving revision 1.2
diff -u -r1.2 IScannerInfoProvider.java
--- parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java	10 Jul 2003 17:50:34 -0000	1.2
+++ parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java	13 Aug 2003 14:43:51 -0000
@@ -1,7 +1,6 @@
 package org.eclipse.cdt.core.parser;
 
 import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
 
 /**********************************************************************
  * Copyright (c) 2002,2003 Rational Software Corporation and others.
@@ -15,7 +14,16 @@
 ***********************************************************************/
 
 public interface IScannerInfoProvider {
-	
+
+	/**
+	 * The receiver will answer the current state of the build information for the 
+	 * resource specified in the argument.
+	 * 
+	 * @param resource
+	 * @return
+	 */
+	public IScannerInfo getScannerInformation(IResource resource); 	
+
 	/**
 	 * The receiver will register the listener specified in the argument
 	 * to receive change notifications when the information for the 
@@ -24,15 +32,6 @@
 	 * @param listener
 	 */
 	public void subscribe(IResource resource, IScannerInfoChangeListener listener);
-	
-	/**
-	 * Answers <code>true</code> if the receiver has information for
-	 * the resource specified in the argument, else <code>false</code>. 
-	 * 
-	 * @param resource
-	 * @return
-	 */
-	public boolean managesResource(IResource resource) throws CoreException;
 	
 	/**
 	 * The receiver will no longer notify the listener specified in 
Index: schema/ScannerInfoProvider.exsd
===================================================================
RCS file: schema/ScannerInfoProvider.exsd
diff -N schema/ScannerInfoProvider.exsd
--- schema/ScannerInfoProvider.exsd	4 Jul 2003 18:36:45 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,121 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.cdt.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.cdt.core" id="ScannerInfoProvider" name="Scanner Information Provider"/>
-      </appInfo>
-      <documentation>
-         This extension point provides a mechanism for the clients of the scanner to discover providers of information the scanner requires to function properly. This information is usually provided by a build system.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="provider">
-      <complexType>
-         <attribute name="id" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A unique name that will be used to reference this parser.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string">
-            <annotation>
-               <documentation>
-                  A fully qualified name of the Java class that implements &lt;samp&gt;org.eclipse.cdt.core.parser.IScannerProviderInfo&lt;/samp&gt; interface
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java" basedOn="org.eclipse.cdt.core.parser.IScannerProviderInfo"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         1.2
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         [Enter extension point usage example here.]
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         The following is an example of the extension point usage:
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension
-	id=&quot;org.eclipse.cdt.core.ScannerInfoProvider&quot;
-    name=&quot;Scanner Information Provider&quot;
-    point=&quot;org.eclipse.cdt.core.ScannerInfoProvider&quot;&gt;
-    &lt;provider
-    	id=&quot;org.eclipse.cdt.core.provider.managed&quot;
-    	class=&quot;org.eclipse.cdt.core.build.managed.ManagedBuildManager&quot;&gt;
-	&lt;/provider&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         [Enter information about supplied implementation of this extension point.]
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-</schema>
Index: src/org/eclipse/cdt/core/CCorePlugin.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java,v
retrieving revision 1.22
diff -u -r1.22 CCorePlugin.java
--- src/org/eclipse/cdt/core/CCorePlugin.java	12 Aug 2003 14:29:07 -0000	1.22
+++ src/org/eclipse/cdt/core/CCorePlugin.java	13 Aug 2003 14:43:52 -0000
@@ -16,6 +16,7 @@
 
 import org.eclipse.cdt.core.index.IndexModel;
 import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.parser.IScannerInfoProvider;
 import org.eclipse.cdt.core.resources.IConsole;
 import org.eclipse.cdt.internal.core.CDescriptorManager;
 import org.eclipse.cdt.internal.core.CPathEntry;
@@ -57,7 +58,12 @@
 	public final static String DEFAULT_BINARY_PARSER_SIMPLE_ID = "ELF";
 	public final static String DEFAULT_BINARY_PARSER_UNIQ_ID = PLUGIN_ID + "." + DEFAULT_BINARY_PARSER_SIMPLE_ID;
 	public final static String PREF_USE_NEW_PARSER = "useNewParser";
-    
+	
+	// Build Model Interface Discovery
+	public final static String BUILD_SCANNER_INFO_SIMPLE_ID = "ScannerInfoProvider";
+	public final static String BUILD_SCANNER_INFO_UNIQ_ID = PLUGIN_ID + "." + BUILD_SCANNER_INFO_SIMPLE_ID;
+	
+	    
     /**
      * Possible configurable option ID.
      * @see #getDefaultOptions
@@ -695,6 +701,21 @@
 			}
 		}
 		return null;
+	}
+	
+	
+	public IScannerInfoProvider getScannerInfoProvider(IProject project) {
+		IScannerInfoProvider provider = null;
+		if (project != null) {
+			try {
+				ICDescriptor desc = (ICDescriptor) getCProjectDescription(project);
+				ICExtensionReference[] extensions = desc.get(BUILD_SCANNER_INFO_UNIQ_ID);
+				if (extensions.length > 0)
+					provider = (IScannerInfoProvider) extensions[0].createExtension();
+			} catch (CoreException e) {
+			}
+		}
+		return provider;
 	}
 
 	// Preference to turn on/off the new parser
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.57
diff -u -r1.57 ChangeLog
--- ChangeLog	12 Aug 2003 22:22:58 -0000	1.57
+++ ChangeLog	13 Aug 2003 14:49:51 -0000
@@ -1,3 +1,16 @@
+2003-08-13 Sean Evoy
+	Renamed the 'AllBuildTest' class to 'ManagedBuildTest' and updated the 
+	integration suite class.
+	* suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java
+
+	This class is renamed. It also has a renamed method 'testProjectCreation'
+	that creates a project the same way the new project wizard does. It uses
+	the new discovery mechanism to find the scanner info provider.
+	* build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
+	
+	Uses the new discovery mechanism to find the scanner info provider.
+	* build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java
+
 2003-08-12 Bogdan Gheorghe
 	Changed the order of tests in AutomatedIntegrationSuite to have
 	the indexing tests run last (the last indexing test shuts down
@@ -819,4 +832,3 @@
 	src/org/eclipse/cdt/testplugin/CProjectHelper.jada
     Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc.
     
->>>>>>> 1.36
Index: build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
===================================================================
RCS file: build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
diff -N build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java	29 Jul 2003 14:28:32 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,744 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors: 
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.cdt.core.build.managed.tests;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.build.managed.BuildException;
-import org.eclipse.cdt.core.build.managed.IConfiguration;
-import org.eclipse.cdt.core.build.managed.IOption;
-import org.eclipse.cdt.core.build.managed.IOptionCategory;
-import org.eclipse.cdt.core.build.managed.IManagedBuildInfo;
-import org.eclipse.cdt.core.build.managed.ITarget;
-import org.eclipse.cdt.core.build.managed.ITool;
-import org.eclipse.cdt.core.build.managed.ManagedBuildManager;
-import org.eclipse.cdt.core.parser.IScannerInfo;
-import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
-import org.eclipse.cdt.core.parser.IScannerInfoProvider;
-import org.eclipse.cdt.internal.core.build.managed.ToolReference;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-
-public class AllBuildTests extends TestCase {
-	private static final boolean boolVal = true;
-	private static final String testConfigName = "test.config.override";
-	private static final String enumVal = "Another Enum";
-	private static final String[] listVal = {"_DEBUG", "/usr/include", "libglade.a"};
-	private static final String projectName = "ManagedBuildTest";
-	private static final String rootExt = "toor";
-	private static final String stringVal = "-c -Wall";
-	private static final String subExt = "bus";
-
-	public AllBuildTests(String name) {
-		super(name);
-	}
-	
-	public static Test suite() {
-		TestSuite suite = new TestSuite(AllBuildTests.class.getName());
-		
-		suite.addTest(new AllBuildTests("testExtensions"));
-		suite.addTest(new AllBuildTests("testProject"));
-		suite.addTest(new AllBuildTests("testConfigurations"));
-		suite.addTest(new AllBuildTests("testTargetArtifacts"));
-		suite.addTest(new AllBuildTests("testScannerInfoInterface"));
-		suite.addTest(new AllBuildTests("cleanup"));
-		
-		return suite;
-	}
-
-	/**
-	 * Navigates through the build info as defined in the extensions
-	 * defined in this plugin
-	 */
-	public void testExtensions() throws Exception {
-		ITarget testRoot = null;
-		ITarget testSub = null;
-		ITarget testSubSub = null;
-		
-		// Note secret null parameter which means just extensions
-		ITarget[] targets = ManagedBuildManager.getDefinedTargets(null);
-
-		for (int i = 0; i < targets.length; ++i) {
-			ITarget target = targets[i];
-			
-			if (target.getName().equals("Test Root")) {
-				testRoot = target;
-				checkRootTarget(testRoot, "x");
-			} else if (target.getName().equals("Test Sub")) {
-				testSub = target;
-				checkSubTarget(testSub);
-			} else if (target.getName().equals("Test Sub Sub")) {
-				testSubSub = target;
-				checkSubSubTarget(testSubSub);
-			}
-		}
-		// All these targets are defines in the plugin files, so none
-		// of them should be null at this point
-		assertNotNull(testRoot);
-		assertNotNull(testSub);
-		assertNotNull(testSubSub);
-	}
-
-
-	/**
-	 * The purpose of this test is to exercise the build path info interface.
-	 * To get to that point, a new target/config has to be created in the test
-	 * project and the default configuration changed.
-	 *  
-	 * @throws CoreException
-	 */
-	public void testScannerInfoInterface(){
-		// Open the test project
-		IProject project = null;
-		try {
-			project = createProject(projectName);
-		} catch (CoreException e) {
-			fail("Failed to open project: " + e.getLocalizedMessage());
-		}
-		
-		// Create a new target in the project based on the sub target
-		ITarget baseTarget = ManagedBuildManager.getTarget(project, "test.sub");
-		assertNotNull(baseTarget);
-		ITarget newTarget = null;
-		try {
-			newTarget = ManagedBuildManager.createTarget(project, baseTarget);
-		} catch (BuildException e) {
-			fail("Failed adding new target to project: " + e.getLocalizedMessage());
-		}
-		assertNotNull(newTarget);
-		// Copy over the configs
-		IConfiguration[] baseConfigs = baseTarget.getConfigurations();
-		for (int i = 0; i < baseConfigs.length; ++i) {
-			newTarget.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i);
-		}
-				
-		// Change the default configuration to the sub config
-		IConfiguration[] configs = newTarget.getConfigurations();
-		assertEquals(3, configs.length);
-		IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
-		buildInfo.setDefaultConfiguration(newTarget.getConfiguration("sub.config.2"));
-
-		// Use the plugin mechanism to discover the supplier of the path information
-		IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
-		if (extensionPoint == null) {
-			fail("Failed to retrieve the extension point ScannerInfoProvider.");
-		}
-		IExtension[] extensions = extensionPoint.getExtensions();
-		IScannerInfoProvider provider = null;
-		// Find the first IScannerInfoProvider that supplies build info for the project
-		for (int i = 0; i < extensions.length && provider == null; i++) {
-			IExtension extension = extensions[i];
-			IConfigurationElement[] elements = extension.getConfigurationElements();
-			for (int j = 0; j < elements.length; ++j) {
-				IConfigurationElement element = elements[j];
-				if (element.getName().equals("provider")) { 
-					// Check if it handles the info for the project
-					try {
-						IScannerInfoProvider temp = (IScannerInfoProvider)element.createExecutableExtension("class");
-						if (temp.managesResource(project)) {
-							provider = temp;
-							break;
-						}
-					} catch (CoreException e) {
-						fail("Failed retrieving scanner info provider from plugin: " + e.getLocalizedMessage());
-					}
-				}
-			}
-		}
-		assertNotNull(provider);
-		provider.subscribe(project, new IScannerInfoChangeListener () {
-			public void changeNotification(IResource project, IScannerInfo info) {
-				// Test the symbols 
-				Map definedSymbols = info.getDefinedSymbols();
-				assertTrue(definedSymbols.containsKey("DEBUG"));
-				assertTrue(definedSymbols.containsKey("GNOME"));
-				assertTrue(definedSymbols.containsValue("ME"));
-				assertEquals((String)definedSymbols.get("DEBUG"), "");
-				assertEquals((String)definedSymbols.get("GNOME"), "ME");
-				// Test the includes path
-				String[] expectedPaths = {"/usr/include", "/opt/gnome/include", "/home/tester/include"};
-				String[] actualPaths = info.getIncludePaths();
-				assertTrue(Arrays.equals(expectedPaths, actualPaths));
-			}
-		});
-		
-		// Add some defined symbols programmatically
-		String[] expectedSymbols = {"DEBUG", "GNOME = ME "};
-		IConfiguration defaultConfig = buildInfo.getDefaultConfiguration(newTarget);
-		ITool[] tools = defaultConfig.getTools();
-		ITool subTool = null;
-		for (int i = 0; i < tools.length; i++) {
-			ITool tool = tools[i];
-			if("tool.sub".equalsIgnoreCase(tool.getId())) {
-				subTool = tool;
-				break;
-			}
-		}
-		assertNotNull(subTool);
-		IOption symbolOpt = null;
-		IOption[] opts = subTool.getOptions();
-		for (int i = 0; i < opts.length; i++) {
-			IOption option = opts[i];
-			if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
-				symbolOpt = option;
-				break;
-			}
-		}
-		assertNotNull(symbolOpt);
-		ManagedBuildManager.setOption(defaultConfig, symbolOpt, expectedSymbols);
-	}
-	
-	/**
-	 * Create a new configuration based on one defined in the plugin file.
-	 * Overrides all of the configuration settings. Saves, closes, and reopens 
-	 * the project. Then calls a method to check the overridden options.
-	 * 
-	 * Tests creating a new configuration.
-	 * Tests setting options.
-	 * Tests persisting overridden options between project sessions.
-	 * 
-	 */
-	public void testConfigurations() throws CoreException, BuildException {
-		// Open the test project
-		IProject project = createProject(projectName);
-		
-		// Make sure there is one and only one target with 2 configs
-		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, definedTargets.length);
-		ITarget rootTarget = definedTargets[0];
-		IConfiguration[] definedConfigs = rootTarget.getConfigurations(); 		
-		assertEquals(2, definedConfigs.length);
-		IConfiguration baseConfig = definedConfigs[0];
-		
-		// Create a new configuration
-		IConfiguration newConfig = rootTarget.createConfiguration(baseConfig, testConfigName);
-		assertEquals(3, rootTarget.getConfigurations().length);
-
-		// There is only one tool
-		ITool[] definedTools = newConfig.getTools();
-		assertEquals(1, definedTools.length);
-		ITool rootTool = definedTools[0];
-		
-		// Override options in the new configuration
-		IOptionCategory topCategory = rootTool.getTopOptionCategory();
-		assertEquals("Root Tool", topCategory.getName());
-		IOption[] options = topCategory.getOptions(null);
-		assertEquals(2, options.length);
-		ManagedBuildManager.setOption(newConfig, options[0], listVal);
-		ManagedBuildManager.setOption(newConfig, options[1], boolVal);
-
-		IOptionCategory[] categories = topCategory.getChildCategories();
-		assertEquals(1, categories.length);
-		options = categories[0].getOptions(null);
-		assertEquals(2, options.length);
-		ManagedBuildManager.setOption(newConfig, options[0], stringVal);
-		ManagedBuildManager.setOption(newConfig, options[1], enumVal);
-
-		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
-		project.close(null);
-		ManagedBuildManager.removeBuildInfo(project);
-		project.open(null);
-
-		// Test the values in the new configuration
-		checkOptionReferences(project);
-	}
-	
-	/**
-	 * @throws CoreException
-	 * @throws BuildException
-	 */
-	public void testProject() throws BuildException {
-		// Create new project
-		IProject project = null;
-		try {
-			project = createProject(projectName);
-		} catch (CoreException e) {
-			fail("Test failed on project creation: " + e.getLocalizedMessage());
-		}
-		// There should not be any targets defined for this project yet
-		assertEquals(0, ManagedBuildManager.getTargets(project).length);
-		
-		// Find the base target definition
-		ITarget targetDef = ManagedBuildManager.getTarget(project, "test.root");
-		assertNotNull(targetDef);
-		
-		// Create the target for our project that builds a dummy executable
-		ITarget newTarget = ManagedBuildManager.createTarget(project, targetDef);
-		assertEquals(newTarget.getName(), targetDef.getName());
-		assertFalse(newTarget.equals(targetDef));
-		String buildArtifactName = projectName + "." + newTarget.getDefaultExtension();
-		newTarget.setBuildArtifact(buildArtifactName);
-		
-		ITarget[] targets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, targets.length);
-		ITarget target = targets[0];
-		assertEquals(target, newTarget);
-		assertFalse(target.equals(targetDef));
-
-		// Copy over the configs
-		IConfiguration defaultConfig = null;
-		IConfiguration[] configs = targetDef.getConfigurations();
-		for (int i = 0; i < configs.length; ++i) {
-			// Make the first configuration the default 
-			if (i == 0) {
-				defaultConfig = target.createConfiguration(configs[i], target.getId() + "." + i);
-			} else {
-				target.createConfiguration(configs[i], target.getId() + "." + i);
-			}
-		}
-		ManagedBuildManager.setDefaultConfiguration(project, defaultConfig);		
-		checkRootTarget(target, "x");
-		
-		// Override the "String Option in Category" option value
-		configs = target.getConfigurations();
-		ITool[] tools = configs[0].getTools();
-		IOptionCategory topCategory = tools[0].getTopOptionCategory();
-		IOptionCategory[] categories = topCategory.getChildCategories();
-		IOption[] options = categories[0].getOptions(configs[0]);
-		configs[0].setOption(options[0], "z");
-		options = categories[0].getOptions(null);
-		assertEquals("x", options[0].getStringValue());
-		options = categories[0].getOptions(configs[0]);
-		assertEquals("z", options[0].getStringValue());
-		
-		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
-		try {
-			project.close(null);
-		} catch (CoreException e) {
-			fail("Failed on project close: " + e.getLocalizedMessage());
-		}
-		ManagedBuildManager.removeBuildInfo(project);
-		try {
-			project.open(null);
-		} catch (CoreException e) {
-			fail("Failed on project open: " + e.getLocalizedMessage());
-		}
-		
-		// Test that the default config was remembered
-		IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
-		assertEquals(defaultConfig.getId(), info.getDefaultConfiguration(target).getId());
-
-		// Get the targets
-		targets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, targets.length);
-		// See if the artifact name is remembered
-		assertEquals(targets[0].getArtifactName(), buildArtifactName);
-		// Check the rest of the default information
-		checkRootTarget(targets[0], "z");
-		
-		// Now test the information the makefile builder needs
-		checkBuildTestSettings(info);
-		ManagedBuildManager.removeBuildInfo(project);
-	}
-	
-	/**
-	 * Tests the tool settings through the interface the makefile generator
-	 * uses.
-	 * 
-	 * @param project
-	 */
-	private void checkBuildTestSettings(IManagedBuildInfo info) {
-		String ext1 = "foo";
-		String ext2 = "bar";
-		String badExt = "cpp";
-		String expectedOutput = "toor";
-		String expectedCmd = "doIt";
-		
-		assertNotNull(info);
-		assertEquals(info.getBuildArtifactName(), projectName + "." + rootExt);
-		
-		// There should be a default configuration defined for the project
-		ITarget buildTarget = info.getDefaultTarget();
-		assertNotNull(buildTarget);
-		assertEquals(buildTarget.getId(), "test.root.1");
-		IConfiguration buildConfig = info.getDefaultConfiguration(buildTarget);
-		assertNotNull(buildConfig);
-		assertEquals(buildConfig.getId(), "test.root.1.0");
-				
-		// The default target should be the same as the one-and-only target in the project
-		List targets = info.getTargets();
-		assertEquals(targets.size(), 1);
-		ITarget target = (ITarget) targets.get(0);
-		assertEquals(target, buildTarget);
-		
-		// Check that tool handles resources with extensions foo and bar by building a baz
-		assertEquals(info.getOutputExtension(ext1), expectedOutput);
-		assertEquals(info.getOutputExtension(ext2), expectedOutput);
-		
-		// Check that it ignores others based on filename extensions
-		assertNull(info.getOutputExtension(badExt));
-		
-		// Now see what the tool command line invocation is for foo and bar
-		assertEquals(info.getToolForSource(ext1), expectedCmd);
-		assertEquals(info.getToolForSource(ext2), expectedCmd);
-		// Make sure that there is no tool to build files of type foo and bar
-		assertNull(info.getToolForTarget(ext1));
-		assertNull(info.getToolForTarget(ext2));
-		
-		// There is no target that builds toor
-		assertNull(info.getToolForSource(expectedOutput));
-		// but there is one that produces it
-		assertEquals(info.getToolForTarget(expectedOutput), expectedCmd);
-		
-		// Now check the build flags
-		assertEquals(info.getFlagsForSource(ext1), "-La -Lb z -e1");
-		assertEquals(info.getFlagsForSource(ext1), info.getFlagsForSource(ext2));
-		
-	}
-	
-	/**
-	 * Tests that overridden options are properly read into build model.
-	 * Test that option values that are not overridden remain the same.
-	 * 
-	 * @param project The project to get build model information for.
-	 * @throws BuildException
-	 */
-	private void checkOptionReferences(IProject project) throws BuildException {
-		// Get the targets out of the project
-		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, definedTargets.length);
-		ITarget rootTarget = definedTargets[0];
-
-		// Now get the configs
-		IConfiguration[] definedConfigs = rootTarget.getConfigurations(); 		
-		assertEquals(3, definedConfigs.length);
-		IConfiguration newConfig = rootTarget.getConfiguration(testConfigName);
-		assertNotNull(newConfig);
-
-		// Now get the tool options and make sure the values are correct		
-		ITool[] definedTools = newConfig.getTools();
-		assertEquals(1, definedTools.length);
-		ITool rootTool = definedTools[0];
-
-		// Check that the options in the new config contain overridden values
-		IOption[] rootOptions = rootTool.getOptions();
-		assertEquals(4, rootOptions.length);
-		// First is the new list
-		assertEquals("List Option in Top", rootOptions[0].getName());
-		assertEquals(IOption.STRING_LIST, rootOptions[0].getValueType());
-		String[] list = rootOptions[0].getStringListValue();
-		assertEquals(3, list.length);
-		assertTrue(Arrays.equals(listVal, list));
-		assertEquals(rootOptions[0].getCommand(), "-L");
-		// Next option is a boolean in top
-		assertEquals("Boolean Option in Top", rootOptions[1].getName());
-		assertEquals(IOption.BOOLEAN, rootOptions[1].getValueType());
-		assertEquals(boolVal, rootOptions[1].getBooleanValue());
-		assertEquals("-b", rootOptions[1].getCommand());
-		// Next option is a string category
-		assertEquals("String Option in Category", rootOptions[2].getName());
-		assertEquals(IOption.STRING, rootOptions[2].getValueType());
-		assertEquals(stringVal, rootOptions[2].getStringValue());
-		// Final option is an enumerated
-		assertEquals("Enumerated Option in Category", rootOptions[3].getName());
-		assertEquals(IOption.ENUMERATED, rootOptions[3].getValueType());
-		String selEnum = rootOptions[3].getSelectedEnum();
-		assertEquals(enumVal, selEnum);
-		String[] enums = rootOptions[3].getApplicableValues();
-		assertEquals(2, enums.length);
-		assertEquals("Default Enum", enums[0]);
-		assertEquals("Another Enum", enums[1]);
-		assertEquals("-e1", rootOptions[3].getEnumCommand(enums[0]));
-		assertEquals("-e2", rootOptions[3].getEnumCommand(enums[1]));
-		assertEquals("-e2", rootOptions[3].getEnumCommand(selEnum));
-	}
-	
-	/*
-	 * Do a full sanity check on the root target.
-	 */
-	private void checkRootTarget(ITarget target, String oicValue) throws BuildException {
-		// Target stuff
-		String expectedCleanCmd = "del /myworld";
-		String expectedMakeCommand = "make";
-		assertTrue(target.isTestTarget());
-		assertEquals(target.getDefaultExtension(), rootExt);
-		assertEquals(expectedCleanCmd, target.getCleanCommand());
-		assertEquals(expectedMakeCommand, target.getMakeCommand());
-		
-		// Tools
-		ITool[] tools = target.getTools();
-		// Root Tool
-		ITool rootTool = tools[0];
-		assertEquals("Root Tool", rootTool.getName());
-		// 4 Options are defined in the root tool
-		IOption[] options = rootTool.getOptions();
-		assertEquals(4, options.length);
-		// First option is a 2-element list
-		assertEquals("List Option in Top", options[0].getName());
-		assertEquals(IOption.STRING_LIST, options[0].getValueType());
-		String[] valueList = options[0].getStringListValue();
-		assertEquals(2, valueList.length);
-		assertEquals("a", valueList[0]);
-		assertEquals("b", valueList[1]);
-		assertEquals(options[0].getCommand(), "-L");
-		// Next option is a boolean in top
-		assertEquals("Boolean Option in Top", options[1].getName());
-		assertEquals(IOption.BOOLEAN, options[1].getValueType());
-		assertEquals(false, options[1].getBooleanValue());
-		assertEquals("-b", options[1].getCommand());
-		// Next option is a string category
-		assertEquals("String Option in Category", options[2].getName());
-		assertEquals(IOption.STRING, options[2].getValueType());
-		assertEquals("x", options[2].getStringValue());
-		// Final option is an enumerated
-		assertEquals("Enumerated Option in Category", options[3].getName());
-		assertEquals(IOption.ENUMERATED, options[3].getValueType());
-		assertEquals("Default Enum", options[3].getSelectedEnum());
-		valueList = options[3].getApplicableValues();
-		assertEquals(2, valueList.length);
-		assertEquals("Default Enum", valueList[0]);
-		assertEquals("Another Enum", valueList[1]);
-		assertEquals("-e1", options[3].getEnumCommand(valueList[0]));
-		assertEquals("-e2", options[3].getEnumCommand(valueList[1]));
-		
-		// Option Categories
-		IOptionCategory topCategory = rootTool.getTopOptionCategory();
-		assertEquals("Root Tool", topCategory.getName());
-		options = topCategory.getOptions(null);
-		assertEquals(2, options.length);
-		assertEquals("List Option in Top", options[0].getName());
-		assertEquals("Boolean Option in Top", options[1].getName());
-		IOptionCategory[] categories = topCategory.getChildCategories();
-		assertEquals(1, categories.length);
-		assertEquals("Category", categories[0].getName());
-		options = categories[0].getOptions(null);
-		assertEquals(2, options.length);
-		assertEquals("String Option in Category", options[0].getName());
-		assertEquals("Enumerated Option in Category", options[1].getName());
-
-		// Configs
-		IConfiguration[] configs = target.getConfigurations();
-		// Root Config
-		IConfiguration rootConfig = configs[0];
-		assertEquals("Root Config", rootConfig.getName());
-		// Tools
-		tools = rootConfig.getTools();
-		assertEquals(1, tools.length);
-		assertEquals("Root Tool", tools[0].getName());
-		assertEquals("-r", tools[0].getOutputFlag());
-		assertTrue(tools[0].buildsFileType("foo"));
-		assertTrue(tools[0].buildsFileType("bar"));
-		assertTrue(tools[0].producesFileType("toor"));
-		assertEquals("doIt", tools[0].getToolCommand());
-		assertEquals("", tools[0].getOutputPrefix());
-
-		// Root Override Config
-		assertEquals("Root Override Config", configs[1].getName());
-		tools = configs[1].getTools();
-		assertEquals(1, tools.length);
-		assertTrue(tools[0] instanceof ToolReference);
-		assertEquals("Root Tool", tools[0].getName());
-		topCategory = tools[0].getTopOptionCategory();
-		options = topCategory.getOptions(configs[1]);
-		assertEquals(2, options.length);
-		assertEquals("List Option in Top", options[0].getName());
-		valueList = options[0].getStringListValue();
-		assertEquals("a", valueList[0]);
-		assertEquals("b", valueList[1]);
-		assertEquals("Boolean Option in Top", options[1].getName());
-		categories = topCategory.getChildCategories();
-		options = categories[0].getOptions(configs[1]);
-		assertEquals(2, options.length);
-		assertEquals("String Option in Category", options[0].getName());
-		assertEquals("y", options[0].getStringValue());
-		assertEquals("Enumerated Option in Category", options[1].getName());
-		valueList = options[1].getApplicableValues();
-		assertEquals(2, valueList.length);
-		assertEquals("Default Enum", valueList[0]);
-		assertEquals("Another Enum", valueList[1]);
-		assertEquals("-e1", options[1].getEnumCommand(valueList[0]));
-		assertEquals("-e2", options[1].getEnumCommand(valueList[1]));
-		assertEquals(1, tools.length);
-		assertEquals("Root Tool", tools[0].getName());
-		assertEquals("-r", tools[0].getOutputFlag());
-		assertTrue(tools[0].buildsFileType("foo"));
-		assertTrue(tools[0].buildsFileType("bar"));
-		assertTrue(tools[0].producesFileType("toor"));
-		assertEquals("doIt", tools[0].getToolCommand());
-	}
-
-	/**
-	 * @param testSubSub
-	 */
-	private void checkSubSubTarget(ITarget target) {
-		// Check the inherited clean command
-		assertEquals("rm -yourworld", target.getCleanCommand());
-		assertEquals("nmake", target.getMakeCommand());
-		
-	}
-
-	/*
-	 * Do a sanity check on the values in the sub-target. Most of the
-	 * sanity on the how build model entries are read is performed in 
-	 * the root target check, so these tests just verify that the the sub 
-	 * target properly inherits from its parent. For the new options
-	 * in the sub target, the test does a sanity check just to be complete.
-	 */
-	private void checkSubTarget(ITarget target) throws BuildException {
-		// Check the overridden clan command
-		assertEquals("rm -yourworld", target.getCleanCommand());
-		assertEquals("gmake", target.getMakeCommand());
-
-		// Make sure this is a test target
-		assertTrue(target.isTestTarget());
-		// Make sure the build artifact extension is there
-		assertEquals(target.getDefaultExtension(), subExt);
-				
-		// Get the tools for this target
-		ITool[] tools = target.getTools();
-		// Do we inherit properly from parent
-		ITool rootTool = tools[0];
-		assertEquals("Root Tool", rootTool.getName());
-		// Now get the tool defined for this target
-		ITool subTool = tools[1];
-		assertEquals("Sub Tool", subTool.getName());
-		// Confirm that it has three options
-		IOption[] subOpts = subTool.getOptions();
-		assertEquals(3, subOpts.length);
-		assertEquals("", subTool.getOutputFlag());
-		assertTrue(subTool.buildsFileType("yarf"));
-		assertTrue(subTool.producesFileType("bus"));
-		assertEquals("", subTool.getToolCommand());
-		assertEquals("lib", subTool.getOutputPrefix());
-
-		// Do a sanity check on the options 
-		assertEquals("Include Paths", subOpts[0].getName());
-		assertEquals(IOption.INCLUDE_PATH, subOpts[0].getValueType());
-		String[] incPath = subOpts[0].getIncludePaths();
-		assertEquals(2, incPath.length);
-		assertEquals("/usr/include", incPath[0]);
-		assertEquals("/opt/gnome/include", incPath[1]);
-		assertEquals("-I", subOpts[0].getCommand());
-		assertEquals("Defined Symbols", subOpts[1].getName());
-		assertEquals(IOption.PREPROCESSOR_SYMBOLS, subOpts[1].getValueType());
-		String[] defdSymbols = subOpts[1].getDefinedSymbols();
-		assertEquals(0, defdSymbols.length);
-		assertEquals("-D", subOpts[1].getCommand());
-		assertEquals("More Includes", subOpts[2].getName());
-		assertEquals(IOption.INCLUDE_PATH, subOpts[2].getValueType());
-		String[] moreIncPath = subOpts[2].getIncludePaths();
-		assertEquals(1, moreIncPath.length);
-		assertEquals("/home/tester/include", moreIncPath[0]);
-		assertEquals("-I", subOpts[2].getCommand());
-
-		// Get the configs for this target
-		IConfiguration[] configs = target.getConfigurations();
-		// Check inheritance
-		IConfiguration rootConfig = configs[0];
-		assertEquals("Root Config", rootConfig.getName());
-		assertEquals("Root Override Config", configs[1].getName());
-		// Check the defined config for target
-		IConfiguration subConfig = configs[2];
-		assertEquals("Sub Config", subConfig.getName());
-	}
-
-	/**
-	 * Remove all the project information associated with the project used during test.
-	 */
-	public void cleanup() {
-		removeProject(projectName);
-	}
-	
-	/**
-	 * Create a new project named <code>name</code> or return the project in 
-	 * the workspace of the same name if it exists.
-	 * 
-	 * @param name The name of the project to create or retrieve.
-	 * @return 
-	 * @throws CoreException
-	 */
-	private IProject createProject(String name) throws CoreException {
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IProject project = root.getProject(name);
-		if (!project.exists()) {
-			project.create(null);
-		} else {
-			project.refreshLocal(IResource.DEPTH_INFINITE, null);
-		}
-        
-		if (!project.isOpen()) {
-			project.open(null);
-		}
-		
-		//CCorePlugin.getDefault().convertProjectToC(project, null, CCorePlugin.PLUGIN_ID + ".make", true);
-
-		return project;	
-	}
-	
-	/**
-	 * Remove the <code>IProject</code> with the name specified in the argument from the 
-	 * receiver's workspace.
-	 *  
-	 * @param name
-	 */
-	private void removeProject(String name) {
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IProject project = root.getProject(name);
-		if (project.exists()) {
-			try {
-				project.delete(true, false, null);
-			} catch (CoreException e) {
-				assertTrue(false);
-			}
-		}
-	}
-	
-	/**
-	 * Test that the build artifact of a <code>ITarget</code> can be modified
-	 * programmatically.
-	 */
-	public void testTargetArtifacts () throws CoreException {
-		// Open the test project
-		IProject project = createProject(projectName);
-		
-		// Make sure there is one and only one target
-		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, definedTargets.length);
-		ITarget rootTarget = definedTargets[0];
-		
-		// Set the build artifact of the target
-		String ext = rootTarget.getDefaultExtension();
-		String name = project.getName() + "." + ext;
-		rootTarget.setBuildArtifact(name);
-		
-		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
-		project.close(null);
-		ManagedBuildManager.removeBuildInfo(project);
-		project.open(null);
-
-		// Make sure there is one and only one target
-		definedTargets = ManagedBuildManager.getTargets(project);
-		assertEquals(1, definedTargets.length);
-		rootTarget = definedTargets[0];
-		assertEquals(name, rootTarget.getArtifactName());
-	}
-
-	public void testThatAlwaysFails() {
-		assertTrue(false);
-	}
-	
-}
Index: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
===================================================================
RCS file: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
diff -N build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java	13 Aug 2003 14:49:51 -0000
@@ -0,0 +1,764 @@
+/**********************************************************************
+ * Copyright (c) 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ * 
+ * Contributors: 
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.core.build.managed.tests;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.ManagedCProjectNature;
+import org.eclipse.cdt.core.build.managed.BuildException;
+import org.eclipse.cdt.core.build.managed.IConfiguration;
+import org.eclipse.cdt.core.build.managed.IManagedBuildInfo;
+import org.eclipse.cdt.core.build.managed.IOption;
+import org.eclipse.cdt.core.build.managed.IOptionCategory;
+import org.eclipse.cdt.core.build.managed.ITarget;
+import org.eclipse.cdt.core.build.managed.ITool;
+import org.eclipse.cdt.core.build.managed.ManagedBuildManager;
+import org.eclipse.cdt.core.parser.IScannerInfo;
+import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
+import org.eclipse.cdt.core.parser.IScannerInfoProvider;
+import org.eclipse.cdt.internal.core.build.managed.ToolReference;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+public class ManagedBuildTests extends TestCase {
+	private static final boolean boolVal = true;
+	private static final String PROJECT_ID = CCorePlugin.PLUGIN_ID + ".make";
+	private static final String testConfigName = "test.config.override";
+	private static final String enumVal = "Another Enum";
+	private static final String[] listVal = {"_DEBUG", "/usr/include", "libglade.a"};
+	private static final String projectName = "ManagedBuildTest";
+	private static final String rootExt = "toor";
+	private static final String stringVal = "-c -Wall";
+	private static final String subExt = "bus";
+
+	public ManagedBuildTests(String name) {
+		super(name);
+	}
+	
+	public static Test suite() {
+		TestSuite suite = new TestSuite(ManagedBuildTests.class.getName());
+		
+		suite.addTest(new ManagedBuildTests("testExtensions"));
+		suite.addTest(new ManagedBuildTests("testProjectCreation"));
+		suite.addTest(new ManagedBuildTests("testConfigurations"));
+		suite.addTest(new ManagedBuildTests("testTargetArtifacts"));
+		suite.addTest(new ManagedBuildTests("testScannerInfoInterface"));
+		suite.addTest(new ManagedBuildTests("cleanup"));
+		
+		return suite;
+	}
+
+	/**
+	 * Navigates through the build info as defined in the extensions
+	 * defined in this plugin
+	 */
+	public void testExtensions() throws Exception {
+		ITarget testRoot = null;
+		ITarget testSub = null;
+		ITarget testSubSub = null;
+		
+		// Note secret null parameter which means just extensions
+		ITarget[] targets = ManagedBuildManager.getDefinedTargets(null);
+
+		for (int i = 0; i < targets.length; ++i) {
+			ITarget target = targets[i];
+			
+			if (target.getName().equals("Test Root")) {
+				testRoot = target;
+				checkRootTarget(testRoot, "x");
+			} else if (target.getName().equals("Test Sub")) {
+				testSub = target;
+				checkSubTarget(testSub);
+			} else if (target.getName().equals("Test Sub Sub")) {
+				testSubSub = target;
+				checkSubSubTarget(testSubSub);
+			}
+		}
+		// All these targets are defines in the plugin files, so none
+		// of them should be null at this point
+		assertNotNull(testRoot);
+		assertNotNull(testSub);
+		assertNotNull(testSubSub);
+	}
+
+
+	/**
+	 * The purpose of this test is to exercise the build path info interface.
+	 * To get to that point, a new target/config has to be created in the test
+	 * project and the default configuration changed.
+	 *  
+	 * @throws CoreException
+	 */
+	public void testScannerInfoInterface(){
+		// These are the expected path settings
+		final String[] expectedPaths = {"/usr/include", "/opt/gnome/include", "/home/tester/include"};
+
+		// Open the test project
+		IProject project = null;
+		try {
+			project = createProject(projectName);
+		} catch (CoreException e) {
+			fail("Failed to open project: " + e.getLocalizedMessage());
+		}
+		
+		// Create a new target in the project based on the sub target
+		ITarget baseTarget = ManagedBuildManager.getTarget(project, "test.sub");
+		assertNotNull(baseTarget);
+		ITarget newTarget = null;
+		try {
+			newTarget = ManagedBuildManager.createTarget(project, baseTarget);
+		} catch (BuildException e) {
+			fail("Failed adding new target to project: " + e.getLocalizedMessage());
+		}
+		assertNotNull(newTarget);
+		// Copy over the configs
+		IConfiguration[] baseConfigs = baseTarget.getConfigurations();
+		for (int i = 0; i < baseConfigs.length; ++i) {
+			newTarget.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i);
+		}
+				
+		// Change the default configuration to the sub config
+		IConfiguration[] configs = newTarget.getConfigurations();
+		assertEquals(3, configs.length);
+		IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
+		buildInfo.setDefaultConfiguration(newTarget.getConfiguration("sub.config.2"));
+
+		// Use the plugin mechanism to discover the supplier of the path information
+		IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
+		if (extensionPoint == null) {
+			fail("Failed to retrieve the extension point ScannerInfoProvider.");
+		}
+
+		// Find the first IScannerInfoProvider that supplies build info for the project
+		IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project);
+		assertNotNull(provider);
+		
+		// Check the build information right away
+		IScannerInfo currentSettings = provider.getScannerInformation(project);
+		Map currentSymbols = currentSettings.getDefinedSymbols();
+		assertTrue(currentSymbols.isEmpty());
+		String[] currentPaths = currentSettings.getIncludePaths();
+		assertTrue(Arrays.equals(expectedPaths, currentPaths));
+		
+		// Now subscribe (note that the method will be called after a change
+		provider.subscribe(project, new IScannerInfoChangeListener () {
+			public void changeNotification(IResource project, IScannerInfo info) {
+				// Test the symbols 
+				Map definedSymbols = info.getDefinedSymbols();
+				assertTrue(definedSymbols.containsKey("DEBUG"));
+				assertTrue(definedSymbols.containsKey("GNOME"));
+				assertTrue(definedSymbols.containsValue("ME"));
+				assertEquals((String)definedSymbols.get("DEBUG"), "");
+				assertEquals((String)definedSymbols.get("GNOME"), "ME");
+				// Test the includes path
+				String[] actualPaths = info.getIncludePaths();
+				assertTrue(Arrays.equals(expectedPaths, actualPaths));
+			}
+		});
+		
+		// Add some defined symbols programmatically
+		String[] expectedSymbols = {"DEBUG", "GNOME = ME "};
+		IConfiguration defaultConfig = buildInfo.getDefaultConfiguration(newTarget);
+		ITool[] tools = defaultConfig.getTools();
+		ITool subTool = null;
+		for (int i = 0; i < tools.length; i++) {
+			ITool tool = tools[i];
+			if("tool.sub".equalsIgnoreCase(tool.getId())) {
+				subTool = tool;
+				break;
+			}
+		}
+		assertNotNull(subTool);
+		IOption symbolOpt = null;
+		IOption[] opts = subTool.getOptions();
+		for (int i = 0; i < opts.length; i++) {
+			IOption option = opts[i];
+			if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
+				symbolOpt = option;
+				break;
+			}
+		}
+		assertNotNull(symbolOpt);
+		ManagedBuildManager.setOption(defaultConfig, symbolOpt, expectedSymbols);
+	}
+	
+	/**
+	 * Create a new configuration based on one defined in the plugin file.
+	 * Overrides all of the configuration settings. Saves, closes, and reopens 
+	 * the project. Then calls a method to check the overridden options.
+	 * 
+	 * Tests creating a new configuration.
+	 * Tests setting options.
+	 * Tests persisting overridden options between project sessions.
+	 * 
+	 */
+	public void testConfigurations() throws CoreException, BuildException {
+		// Open the test project
+		IProject project = createProject(projectName);
+		
+		// Make sure there is one and only one target with 2 configs
+		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, definedTargets.length);
+		ITarget rootTarget = definedTargets[0];
+		IConfiguration[] definedConfigs = rootTarget.getConfigurations(); 		
+		assertEquals(2, definedConfigs.length);
+		IConfiguration baseConfig = definedConfigs[0];
+		
+		// Create a new configuration
+		IConfiguration newConfig = rootTarget.createConfiguration(baseConfig, testConfigName);
+		assertEquals(3, rootTarget.getConfigurations().length);
+
+		// There is only one tool
+		ITool[] definedTools = newConfig.getTools();
+		assertEquals(1, definedTools.length);
+		ITool rootTool = definedTools[0];
+		
+		// Override options in the new configuration
+		IOptionCategory topCategory = rootTool.getTopOptionCategory();
+		assertEquals("Root Tool", topCategory.getName());
+		IOption[] options = topCategory.getOptions(null);
+		assertEquals(2, options.length);
+		ManagedBuildManager.setOption(newConfig, options[0], listVal);
+		ManagedBuildManager.setOption(newConfig, options[1], boolVal);
+
+		IOptionCategory[] categories = topCategory.getChildCategories();
+		assertEquals(1, categories.length);
+		options = categories[0].getOptions(null);
+		assertEquals(2, options.length);
+		ManagedBuildManager.setOption(newConfig, options[0], stringVal);
+		ManagedBuildManager.setOption(newConfig, options[1], enumVal);
+
+		// Save, close, reopen and test again
+		ManagedBuildManager.saveBuildInfo(project);
+		project.close(null);
+		ManagedBuildManager.removeBuildInfo(project);
+		project.open(null);
+
+		// Test the values in the new configuration
+		checkOptionReferences(project);
+	}
+	
+	/**
+	 * @throws CoreException
+	 * @throws BuildException
+	 */
+	public void testProjectCreation() throws BuildException {
+		// Create new project
+		IProject project = null;
+		try {
+			project = createProject(projectName);
+			// Now associate the builder with the project
+			addManagedBuildNature(project);
+		} catch (CoreException e) {
+			fail("Test failed on project creation: " + e.getLocalizedMessage());
+		}
+		// There should not be any targets defined for this project yet
+		assertEquals(0, ManagedBuildManager.getTargets(project).length);
+		
+		// Find the base target definition
+		ITarget targetDef = ManagedBuildManager.getTarget(project, "test.root");
+		assertNotNull(targetDef);
+		
+		// Create the target for our project that builds a dummy executable
+		ITarget newTarget = ManagedBuildManager.createTarget(project, targetDef);
+		assertEquals(newTarget.getName(), targetDef.getName());
+		assertFalse(newTarget.equals(targetDef));
+		String buildArtifactName = projectName + "." + newTarget.getDefaultExtension();
+		newTarget.setBuildArtifact(buildArtifactName);
+		
+		ITarget[] targets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, targets.length);
+		ITarget target = targets[0];
+		assertEquals(target, newTarget);
+		assertFalse(target.equals(targetDef));
+
+		// Copy over the configs
+		IConfiguration defaultConfig = null;
+		IConfiguration[] configs = targetDef.getConfigurations();
+		for (int i = 0; i < configs.length; ++i) {
+			// Make the first configuration the default 
+			if (i == 0) {
+				defaultConfig = target.createConfiguration(configs[i], target.getId() + "." + i);
+			} else {
+				target.createConfiguration(configs[i], target.getId() + "." + i);
+			}
+		}
+		ManagedBuildManager.setDefaultConfiguration(project, defaultConfig);		
+		checkRootTarget(target, "x");
+		
+		// Override the "String Option in Category" option value
+		configs = target.getConfigurations();
+		ITool[] tools = configs[0].getTools();
+		IOptionCategory topCategory = tools[0].getTopOptionCategory();
+		IOptionCategory[] categories = topCategory.getChildCategories();
+		IOption[] options = categories[0].getOptions(configs[0]);
+		configs[0].setOption(options[0], "z");
+		options = categories[0].getOptions(null);
+		assertEquals("x", options[0].getStringValue());
+		options = categories[0].getOptions(configs[0]);
+		assertEquals("z", options[0].getStringValue());
+		
+		// Save, close, reopen and test again
+		ManagedBuildManager.saveBuildInfo(project);
+		try {
+			project.close(null);
+		} catch (CoreException e) {
+			fail("Failed on project close: " + e.getLocalizedMessage());
+		}
+		ManagedBuildManager.removeBuildInfo(project);
+		try {
+			project.open(null);
+		} catch (CoreException e) {
+			fail("Failed on project open: " + e.getLocalizedMessage());
+		}
+		
+		// Test that the default config was remembered
+		IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+		assertEquals(defaultConfig.getId(), info.getDefaultConfiguration(target).getId());
+
+		// Get the targets
+		targets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, targets.length);
+		// See if the artifact name is remembered
+		assertEquals(targets[0].getArtifactName(), buildArtifactName);
+		// Check the rest of the default information
+		checkRootTarget(targets[0], "z");
+		
+		// Now test the information the makefile builder needs
+		checkBuildTestSettings(info);
+		ManagedBuildManager.removeBuildInfo(project);
+	}
+	
+	private void addManagedBuildNature (IProject project) {
+		// Add the managed build nature
+		try {
+			ManagedCProjectNature.addManagedNature(project, new NullProgressMonitor());
+		} catch (CoreException e) {
+			fail("Test failed on adding managed build nature: " + e.getLocalizedMessage());
+		}
+
+		// Associate the project with the managed builder so the clients can get proper information
+		try {
+			ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project);
+			desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+			desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
+		} catch (CoreException e) {
+			fail("Test failed on adding managed builder as scanner info provider: " + e.getLocalizedMessage());
+		}
+	}
+
+	/**
+	 * Tests the tool settings through the interface the makefile generator
+	 * uses.
+	 * 
+	 * @param project
+	 */
+	private void checkBuildTestSettings(IManagedBuildInfo info) {
+		String ext1 = "foo";
+		String ext2 = "bar";
+		String badExt = "cpp";
+		String expectedOutput = "toor";
+		String expectedCmd = "doIt";
+		
+		assertNotNull(info);
+		assertEquals(info.getBuildArtifactName(), projectName + "." + rootExt);
+		
+		// There should be a default configuration defined for the project
+		ITarget buildTarget = info.getDefaultTarget();
+		assertNotNull(buildTarget);
+		assertEquals(buildTarget.getId(), "test.root.1");
+		IConfiguration buildConfig = info.getDefaultConfiguration(buildTarget);
+		assertNotNull(buildConfig);
+		assertEquals(buildConfig.getId(), "test.root.1.0");
+				
+		// The default target should be the same as the one-and-only target in the project
+		List targets = info.getTargets();
+		assertEquals(targets.size(), 1);
+		ITarget target = (ITarget) targets.get(0);
+		assertEquals(target, buildTarget);
+		
+		// Check that tool handles resources with extensions foo and bar by building a baz
+		assertEquals(info.getOutputExtension(ext1), expectedOutput);
+		assertEquals(info.getOutputExtension(ext2), expectedOutput);
+		
+		// Check that it ignores others based on filename extensions
+		assertNull(info.getOutputExtension(badExt));
+		
+		// Now see what the tool command line invocation is for foo and bar
+		assertEquals(info.getToolForSource(ext1), expectedCmd);
+		assertEquals(info.getToolForSource(ext2), expectedCmd);
+		// Make sure that there is no tool to build files of type foo and bar
+		assertNull(info.getToolForTarget(ext1));
+		assertNull(info.getToolForTarget(ext2));
+		
+		// There is no target that builds toor
+		assertNull(info.getToolForSource(expectedOutput));
+		// but there is one that produces it
+		assertEquals(info.getToolForTarget(expectedOutput), expectedCmd);
+		
+		// Now check the build flags
+		assertEquals(info.getFlagsForSource(ext1), "-La -Lb z -e1");
+		assertEquals(info.getFlagsForSource(ext1), info.getFlagsForSource(ext2));
+		
+	}
+	
+	/**
+	 * Tests that overridden options are properly read into build model.
+	 * Test that option values that are not overridden remain the same.
+	 * 
+	 * @param project The project to get build model information for.
+	 * @throws BuildException
+	 */
+	private void checkOptionReferences(IProject project) throws BuildException {
+		// Get the targets out of the project
+		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, definedTargets.length);
+		ITarget rootTarget = definedTargets[0];
+
+		// Now get the configs
+		IConfiguration[] definedConfigs = rootTarget.getConfigurations(); 		
+		assertEquals(3, definedConfigs.length);
+		IConfiguration newConfig = rootTarget.getConfiguration(testConfigName);
+		assertNotNull(newConfig);
+
+		// Now get the tool options and make sure the values are correct		
+		ITool[] definedTools = newConfig.getTools();
+		assertEquals(1, definedTools.length);
+		ITool rootTool = definedTools[0];
+
+		// Check that the options in the new config contain overridden values
+		IOption[] rootOptions = rootTool.getOptions();
+		assertEquals(4, rootOptions.length);
+		// First is the new list
+		assertEquals("List Option in Top", rootOptions[0].getName());
+		assertEquals(IOption.STRING_LIST, rootOptions[0].getValueType());
+		String[] list = rootOptions[0].getStringListValue();
+		assertEquals(3, list.length);
+		assertTrue(Arrays.equals(listVal, list));
+		assertEquals(rootOptions[0].getCommand(), "-L");
+		// Next option is a boolean in top
+		assertEquals("Boolean Option in Top", rootOptions[1].getName());
+		assertEquals(IOption.BOOLEAN, rootOptions[1].getValueType());
+		assertEquals(boolVal, rootOptions[1].getBooleanValue());
+		assertEquals("-b", rootOptions[1].getCommand());
+		// Next option is a string category
+		assertEquals("String Option in Category", rootOptions[2].getName());
+		assertEquals(IOption.STRING, rootOptions[2].getValueType());
+		assertEquals(stringVal, rootOptions[2].getStringValue());
+		// Final option is an enumerated
+		assertEquals("Enumerated Option in Category", rootOptions[3].getName());
+		assertEquals(IOption.ENUMERATED, rootOptions[3].getValueType());
+		String selEnum = rootOptions[3].getSelectedEnum();
+		assertEquals(enumVal, selEnum);
+		String[] enums = rootOptions[3].getApplicableValues();
+		assertEquals(2, enums.length);
+		assertEquals("Default Enum", enums[0]);
+		assertEquals("Another Enum", enums[1]);
+		assertEquals("-e1", rootOptions[3].getEnumCommand(enums[0]));
+		assertEquals("-e2", rootOptions[3].getEnumCommand(enums[1]));
+		assertEquals("-e2", rootOptions[3].getEnumCommand(selEnum));
+	}
+	
+	/*
+	 * Do a full sanity check on the root target.
+	 */
+	private void checkRootTarget(ITarget target, String oicValue) throws BuildException {
+		// Target stuff
+		String expectedCleanCmd = "del /myworld";
+		String expectedMakeCommand = "make";
+		assertTrue(target.isTestTarget());
+		assertEquals(target.getDefaultExtension(), rootExt);
+		assertEquals(expectedCleanCmd, target.getCleanCommand());
+		assertEquals(expectedMakeCommand, target.getMakeCommand());
+		
+		// Tools
+		ITool[] tools = target.getTools();
+		// Root Tool
+		ITool rootTool = tools[0];
+		assertEquals("Root Tool", rootTool.getName());
+		// 4 Options are defined in the root tool
+		IOption[] options = rootTool.getOptions();
+		assertEquals(4, options.length);
+		// First option is a 2-element list
+		assertEquals("List Option in Top", options[0].getName());
+		assertEquals(IOption.STRING_LIST, options[0].getValueType());
+		String[] valueList = options[0].getStringListValue();
+		assertEquals(2, valueList.length);
+		assertEquals("a", valueList[0]);
+		assertEquals("b", valueList[1]);
+		assertEquals(options[0].getCommand(), "-L");
+		// Next option is a boolean in top
+		assertEquals("Boolean Option in Top", options[1].getName());
+		assertEquals(IOption.BOOLEAN, options[1].getValueType());
+		assertEquals(false, options[1].getBooleanValue());
+		assertEquals("-b", options[1].getCommand());
+		// Next option is a string category
+		assertEquals("String Option in Category", options[2].getName());
+		assertEquals(IOption.STRING, options[2].getValueType());
+		assertEquals("x", options[2].getStringValue());
+		// Final option is an enumerated
+		assertEquals("Enumerated Option in Category", options[3].getName());
+		assertEquals(IOption.ENUMERATED, options[3].getValueType());
+		assertEquals("Default Enum", options[3].getSelectedEnum());
+		valueList = options[3].getApplicableValues();
+		assertEquals(2, valueList.length);
+		assertEquals("Default Enum", valueList[0]);
+		assertEquals("Another Enum", valueList[1]);
+		assertEquals("-e1", options[3].getEnumCommand(valueList[0]));
+		assertEquals("-e2", options[3].getEnumCommand(valueList[1]));
+		
+		// Option Categories
+		IOptionCategory topCategory = rootTool.getTopOptionCategory();
+		assertEquals("Root Tool", topCategory.getName());
+		options = topCategory.getOptions(null);
+		assertEquals(2, options.length);
+		assertEquals("List Option in Top", options[0].getName());
+		assertEquals("Boolean Option in Top", options[1].getName());
+		IOptionCategory[] categories = topCategory.getChildCategories();
+		assertEquals(1, categories.length);
+		assertEquals("Category", categories[0].getName());
+		options = categories[0].getOptions(null);
+		assertEquals(2, options.length);
+		assertEquals("String Option in Category", options[0].getName());
+		assertEquals("Enumerated Option in Category", options[1].getName());
+
+		// Configs
+		IConfiguration[] configs = target.getConfigurations();
+		// Root Config
+		IConfiguration rootConfig = configs[0];
+		assertEquals("Root Config", rootConfig.getName());
+		// Tools
+		tools = rootConfig.getTools();
+		assertEquals(1, tools.length);
+		assertEquals("Root Tool", tools[0].getName());
+		assertEquals("-r", tools[0].getOutputFlag());
+		assertTrue(tools[0].buildsFileType("foo"));
+		assertTrue(tools[0].buildsFileType("bar"));
+		assertTrue(tools[0].producesFileType("toor"));
+		assertEquals("doIt", tools[0].getToolCommand());
+		assertEquals("", tools[0].getOutputPrefix());
+
+		// Root Override Config
+		assertEquals("Root Override Config", configs[1].getName());
+		tools = configs[1].getTools();
+		assertEquals(1, tools.length);
+		assertTrue(tools[0] instanceof ToolReference);
+		assertEquals("Root Tool", tools[0].getName());
+		topCategory = tools[0].getTopOptionCategory();
+		options = topCategory.getOptions(configs[1]);
+		assertEquals(2, options.length);
+		assertEquals("List Option in Top", options[0].getName());
+		valueList = options[0].getStringListValue();
+		assertEquals("a", valueList[0]);
+		assertEquals("b", valueList[1]);
+		assertEquals("Boolean Option in Top", options[1].getName());
+		categories = topCategory.getChildCategories();
+		options = categories[0].getOptions(configs[1]);
+		assertEquals(2, options.length);
+		assertEquals("String Option in Category", options[0].getName());
+		assertEquals("y", options[0].getStringValue());
+		assertEquals("Enumerated Option in Category", options[1].getName());
+		valueList = options[1].getApplicableValues();
+		assertEquals(2, valueList.length);
+		assertEquals("Default Enum", valueList[0]);
+		assertEquals("Another Enum", valueList[1]);
+		assertEquals("-e1", options[1].getEnumCommand(valueList[0]));
+		assertEquals("-e2", options[1].getEnumCommand(valueList[1]));
+		assertEquals(1, tools.length);
+		assertEquals("Root Tool", tools[0].getName());
+		assertEquals("-r", tools[0].getOutputFlag());
+		assertTrue(tools[0].buildsFileType("foo"));
+		assertTrue(tools[0].buildsFileType("bar"));
+		assertTrue(tools[0].producesFileType("toor"));
+		assertEquals("doIt", tools[0].getToolCommand());
+	}
+
+	/**
+	 * @param testSubSub
+	 */
+	private void checkSubSubTarget(ITarget target) {
+		// Check the inherited clean command
+		assertEquals("rm -yourworld", target.getCleanCommand());
+		assertEquals("nmake", target.getMakeCommand());
+		
+	}
+
+	/*
+	 * Do a sanity check on the values in the sub-target. Most of the
+	 * sanity on the how build model entries are read is performed in 
+	 * the root target check, so these tests just verify that the the sub 
+	 * target properly inherits from its parent. For the new options
+	 * in the sub target, the test does a sanity check just to be complete.
+	 */
+	private void checkSubTarget(ITarget target) throws BuildException {
+		// Check the overridden clan command
+		assertEquals("rm -yourworld", target.getCleanCommand());
+		assertEquals("gmake", target.getMakeCommand());
+
+		// Make sure this is a test target
+		assertTrue(target.isTestTarget());
+		// Make sure the build artifact extension is there
+		assertEquals(target.getDefaultExtension(), subExt);
+				
+		// Get the tools for this target
+		ITool[] tools = target.getTools();
+		// Do we inherit properly from parent
+		ITool rootTool = tools[0];
+		assertEquals("Root Tool", rootTool.getName());
+		// Now get the tool defined for this target
+		ITool subTool = tools[1];
+		assertEquals("Sub Tool", subTool.getName());
+		// Confirm that it has three options
+		IOption[] subOpts = subTool.getOptions();
+		assertEquals(3, subOpts.length);
+		assertEquals("", subTool.getOutputFlag());
+		assertTrue(subTool.buildsFileType("yarf"));
+		assertTrue(subTool.producesFileType("bus"));
+		assertEquals("", subTool.getToolCommand());
+		assertEquals("lib", subTool.getOutputPrefix());
+
+		// Do a sanity check on the options 
+		assertEquals("Include Paths", subOpts[0].getName());
+		assertEquals(IOption.INCLUDE_PATH, subOpts[0].getValueType());
+		String[] incPath = subOpts[0].getIncludePaths();
+		assertEquals(2, incPath.length);
+		assertEquals("/usr/include", incPath[0]);
+		assertEquals("/opt/gnome/include", incPath[1]);
+		assertEquals("-I", subOpts[0].getCommand());
+		assertEquals("Defined Symbols", subOpts[1].getName());
+		assertEquals(IOption.PREPROCESSOR_SYMBOLS, subOpts[1].getValueType());
+		String[] defdSymbols = subOpts[1].getDefinedSymbols();
+		assertEquals(0, defdSymbols.length);
+		assertEquals("-D", subOpts[1].getCommand());
+		assertEquals("More Includes", subOpts[2].getName());
+		assertEquals(IOption.INCLUDE_PATH, subOpts[2].getValueType());
+		String[] moreIncPath = subOpts[2].getIncludePaths();
+		assertEquals(1, moreIncPath.length);
+		assertEquals("/home/tester/include", moreIncPath[0]);
+		assertEquals("-I", subOpts[2].getCommand());
+
+		// Get the configs for this target
+		IConfiguration[] configs = target.getConfigurations();
+		// Check inheritance
+		IConfiguration rootConfig = configs[0];
+		assertEquals("Root Config", rootConfig.getName());
+		assertEquals("Root Override Config", configs[1].getName());
+		// Check the defined config for target
+		IConfiguration subConfig = configs[2];
+		assertEquals("Sub Config", subConfig.getName());
+	}
+
+	/**
+	 * Remove all the project information associated with the project used during test.
+	 */
+	public void cleanup() {
+		removeProject(projectName);
+	}
+	
+	/**
+	 * Create a new project named <code>name</code> or return the project in 
+	 * the workspace of the same name if it exists.
+	 * 
+	 * @param name The name of the project to create or retrieve.
+	 * @return 
+	 * @throws CoreException
+	 */
+	private IProject createProject(String name) throws CoreException {
+		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+		IProject newProjectHandle = root.getProject(name);
+		IProject project = null;
+		
+		if (!newProjectHandle.exists()) {
+			IWorkspace workspace = ResourcesPlugin.getWorkspace();
+			IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
+			//description.setLocation(root.getLocation());
+			project = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), PROJECT_ID);
+		} else {
+			newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, null);
+			project = newProjectHandle;
+		}
+        
+		if (!project.isOpen()) {
+			project.open(null);
+		}
+		
+		return project;	
+	}
+	
+	/**
+	 * Remove the <code>IProject</code> with the name specified in the argument from the 
+	 * receiver's workspace.
+	 *  
+	 * @param name
+	 */
+	private void removeProject(String name) {
+		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+		IProject project = root.getProject(name);
+		if (project.exists()) {
+			try {
+				project.delete(true, false, null);
+			} catch (CoreException e) {
+				assertTrue(false);
+			}
+		}
+	}
+	
+	/**
+	 * Test that the build artifact of a <code>ITarget</code> can be modified
+	 * programmatically.
+	 */
+	public void testTargetArtifacts () throws CoreException {
+		// Open the test project
+		IProject project = createProject(projectName);
+		
+		// Make sure there is one and only one target
+		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, definedTargets.length);
+		ITarget rootTarget = definedTargets[0];
+		
+		// Set the build artifact of the target
+		String ext = rootTarget.getDefaultExtension();
+		String name = project.getName() + "." + ext;
+		rootTarget.setBuildArtifact(name);
+		
+		// Save, close, reopen and test again
+		ManagedBuildManager.saveBuildInfo(project);
+		project.close(null);
+		ManagedBuildManager.removeBuildInfo(project);
+		project.open(null);
+
+		// Make sure there is one and only one target
+		definedTargets = ManagedBuildManager.getTargets(project);
+		assertEquals(1, definedTargets.length);
+		rootTarget = definedTargets[0];
+		assertEquals(name, rootTarget.getArtifactName());
+	}
+
+	public void testThatAlwaysFails() {
+		assertTrue(false);
+	}
+	
+}
Index: build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java,v
retrieving revision 1.2
diff -u -r1.2 StandardBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java	10 Jul 2003 17:50:27 -0000	1.2
+++ build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java	13 Aug 2003 14:49:51 -0000
@@ -10,6 +10,7 @@
 import org.eclipse.cdt.core.CCProjectNature;
 import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.CProjectNature;
+import org.eclipse.cdt.core.ICDescriptor;
 import org.eclipse.cdt.core.build.standard.StandardBuildManager;
 import org.eclipse.cdt.core.parser.IScannerInfo;
 import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
@@ -20,9 +21,6 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
 import org.eclipse.core.runtime.NullProgressMonitor;
 
 /**********************************************************************
@@ -175,38 +173,6 @@
 		return project;	
 	}
 
-	private IScannerInfoProvider findInfoProvider(IProject project) { 
-		// Use the plugin mechanism to discover the supplier of the path information
-		IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
-		if (extensionPoint == null) {
-			fail("StandardBuildTest testScannerListernerInterface failed to retrieve the extension point ScannerInfoProvider.");
-		}
-		IExtension[] extensions = extensionPoint.getExtensions();
-		IScannerInfoProvider provider = null;
-
-		// Find the first IScannerInfoProvider that supplies build info for the project
-		for (int i = 0; i < extensions.length && provider == null; i++) {
-			IExtension extension = extensions[i];
-			IConfigurationElement[] elements = extension.getConfigurationElements();
-			for (int j = 0; j < elements.length; ++j) {
-				IConfigurationElement element = elements[j];
-				if (element.getName().equals("provider")) { 
-					// Check if it handles the info for the project
-					try {
-						IScannerInfoProvider temp = (IScannerInfoProvider)element.createExecutableExtension("class");
-						if (temp.managesResource(project)) {
-							provider = temp;
-							break;
-						}
-					} catch (CoreException e) {
-						fail("Failed retrieving scanner info provider from plugin: " + e.getLocalizedMessage());
-					}
-				}
-			}
-		}
-		return provider;
-	}
-	
 	/**
 	 * Remove the <code>IProject</code> with the name specified in the argument from the 
 	 * receiver's workspace.
@@ -298,6 +264,15 @@
 		} catch (CoreException e) {
 			fail("StandardBuildTest testProjectCreation failed getting nature: " + e.getLocalizedMessage());
 		}
+
+		// Associate the project with the standard builder so the clients can get proper information
+		try {
+			ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project);
+			desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+			desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, StandardBuildManager.INTERFACE_IDENTITY);
+		} catch (CoreException e) {
+			fail("StandardBuildTest testProjectCreation failed setting the StandardBuildManager: " + e.getLocalizedMessage());
+		}
 		
 		// Check the default settings
 		checkDefaultProjectSettings(project);
@@ -353,8 +328,20 @@
 		assertNotNull(project);
 
 		// Find the scanner info provider for this project
-		IScannerInfoProvider provider = findInfoProvider(project);
+		IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project);
 		assertNotNull(provider);
+		
+		// Check out the information we can get through the interface
+		IScannerInfo currentSettings = provider.getScannerInformation(project);
+		Map currentSymbols = currentSettings.getDefinedSymbols();
+		assertTrue(currentSymbols.containsKey("_RELEASE"));
+		assertEquals("", currentSymbols.get("_RELEASE"));
+		assertTrue(currentSymbols.containsKey("YES"));
+		assertEquals("1", currentSymbols.get("YES"));
+		assertTrue(currentSymbols.containsKey("NO"));
+		assertEquals("", currentSymbols.get("NO"));
+		String[] currentPaths = currentSettings.getIncludePaths();
+		assertTrue(Arrays.equals(OVR_INC_PATHS, currentPaths));
 		
 		// Remove what's there
 		StandardBuildManager.setIncludePaths(project, new String[0]);
Index: suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java,v
retrieving revision 1.12
diff -u -r1.12 AutomatedIntegrationSuite.java
--- suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java	12 Aug 2003 22:22:58 -0000	1.12
+++ suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java	13 Aug 2003 14:49:52 -0000
@@ -17,7 +17,7 @@
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
-import org.eclipse.cdt.core.build.managed.tests.AllBuildTests;
+import org.eclipse.cdt.core.build.managed.tests.ManagedBuildTests;
 import org.eclipse.cdt.core.build.managed.tests.StandardBuildTests;
 import org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest;
 import org.eclipse.cdt.core.indexer.tests.IndexManagerTests;
@@ -80,7 +80,7 @@
 		suite.addTest(suite.new GenerateReport("startSuccessTests"));
 
 		// Add all success tests
-		suite.addTest(AllBuildTests.suite());
+		suite.addTest(ManagedBuildTests.suite());
 		suite.addTest(StandardBuildTests.suite());
 		suite.addTest(ParserTestSuite.suite());
 		suite.addTest(AllCoreTests.suite());
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.138
diff -u -r1.138 ChangeLog
--- ChangeLog	12 Aug 2003 20:20:13 -0000	1.138
+++ ChangeLog	13 Aug 2003 14:44:42 -0000
@@ -1,3 +1,19 @@
+2003-08-13 Sean Evoy
+	A simple change to add transparency information to the build property page 
+	GIFs. They were not being drawn properly on Solaris/Motif and would probably
+	have shown the same behaviour on Linux. Now, they all get blitted correctly
+	even with a different widget background colour.
+	* icons/full/build16/build_configs.gif
+	* icons/full/build16/config-category.gif
+	* icons/full/build16/config-tool.gif
+	
+	Updated the new project wizard to register the correct build manager at 
+	project creation time. We have switched to using the CDescriptor mechanism 
+	for provider discovery. In order for the to work, the project has to be updated
+	properly and the only time it can be easily done is at creation time.
+	* build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java
+	* src/org/eclipse/cdt/ui/wizards/CProjectWizard.java
+	
 2003-08-12
 	Added class name validation to NewClassWizardPage
 	Used the new search (indexer) for Code completion in CCompletionProcessor
Index: build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java,v
retrieving revision 1.1
diff -u -r1.1 ManagedProjectWizard.java
--- build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java	9 Jun 2003 19:22:19 -0000	1.1
+++ build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java	13 Aug 2003 14:44:42 -0000
@@ -12,6 +12,7 @@
 ***********************************************************************/
 
 import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ICDescriptor;
 import org.eclipse.cdt.core.ManagedCProjectNature;
 import org.eclipse.cdt.core.build.managed.BuildException;
 import org.eclipse.cdt.core.build.managed.IConfiguration;
@@ -108,6 +109,16 @@
 		} catch (BuildException e) {
 			e.printStackTrace();
 		}
+		
+		// Associate the project with the managed builder so the clients can get proper information
+		try {
+			ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project);
+			desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+			desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
+		} catch (CoreException e) {
+			// TODO Flag the error to the user
+		}
+		
 		// Save the build options
 		monitor.subTask("Saving new build options.");
 		ManagedBuildManager.saveBuildInfo(project);
Index: icons/full/build16/build_configs.gif
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif,v
retrieving revision 1.1
diff -u -r1.1 build_configs.gif
Binary files /tmp/cvs3d6k2E and build_configs.gif differ
Index: icons/full/build16/config-category.gif
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/icons/full/build16/config-category.gif,v
retrieving revision 1.1
diff -u -r1.1 config-category.gif
Binary files /tmp/cvsgfq6sQ and config-category.gif differ
Index: icons/full/build16/config-tool.gif
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif,v
retrieving revision 1.1
diff -u -r1.1 config-tool.gif
Binary files /tmp/cvsleDXQ1 and config-tool.gif differ
Index: src/org/eclipse/cdt/ui/wizards/CProjectWizard.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CProjectWizard.java,v
retrieving revision 1.9
diff -u -r1.9 CProjectWizard.java
--- src/org/eclipse/cdt/ui/wizards/CProjectWizard.java	4 Feb 2003 20:00:45 -0000	1.9
+++ src/org/eclipse/cdt/ui/wizards/CProjectWizard.java	13 Aug 2003 14:44:43 -0000
@@ -10,6 +10,8 @@
 import java.util.List;
 
 import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.build.standard.StandardBuildManager;
 import org.eclipse.cdt.internal.ui.CPluginImages;
 import org.eclipse.cdt.ui.CUIPlugin;
 import org.eclipse.cdt.utils.ui.swt.IValidation;
@@ -58,6 +60,7 @@
 	private static final String WZ_DESC= "CProjectWizard.description"; //$NON-NLS-1$
 
 	private static final String WINDOW_TITLE = "CProjectWizard.windowTitle"; //$NON-NLS-1$
+	
 
 	private String wz_title;
 	private String wz_desc;
@@ -279,6 +282,16 @@
 
 	protected void doRun(IProgressMonitor monitor) throws CoreException {
 		createNewProject(monitor);
+
+		// Associate the project with the standard 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, StandardBuildManager.INTERFACE_IDENTITY);
+		} catch (CoreException e) {
+			// TODO Flag the error to the user
+		}
+
 	}	
 
 	/**

Back to the top