mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
![]() 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. |
||
---|---|---|
.. | ||
org.eclipse.cdt.core | ||
org.eclipse.cdt.core.linux | ||
org.eclipse.cdt.core.qnx | ||
org.eclipse.cdt.core.solaris | ||
org.eclipse.cdt.core.tests | ||
org.eclipse.cdt.core.win32 | ||
org.eclipse.cdt.ui | ||
org.eclipse.cdt.ui.tests |