mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
bug 306708: Update project model with scanner info in CommonBuilder
This commit is contained in:
parent
d06798f4ef
commit
845bf5a063
2 changed files with 15 additions and 2 deletions
|
@ -60,6 +60,11 @@ public class ScannerConfigBuilder extends ACBuilder {
|
|||
* force the discovery, i.e. run the discovery even if it is disabled
|
||||
*/
|
||||
public static final int FORCE_DISCOVERY = 1 << 1;
|
||||
/**
|
||||
* skip running gcc to fetch built-in specs scanner info
|
||||
* @since 7.0
|
||||
*/
|
||||
public static final int SKIP_SI_DISCOVERY = 1 << 2;
|
||||
|
||||
public final static String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ScannerConfigBuilder"; //$NON-NLS-1$
|
||||
|
||||
|
@ -186,8 +191,10 @@ public class ScannerConfigBuilder extends ACBuilder {
|
|||
SCProfileInstance instance = ScannerConfigProfileManager.getInstance().
|
||||
getSCProfileInstance(project, context.toInfoContext(), buildInfo2.getSelectedProfileId());
|
||||
// if there are any providers call job to pull scanner info
|
||||
if ((flags & SKIP_SI_DISCOVERY) == 0) {
|
||||
if ((instance == null) || !buildInfo2.getProviderIdList().isEmpty())
|
||||
instance = CfgSCJobsUtil.getProviderScannerInfo(project, context, instance, buildInfo2, env, new SubProgressMonitor(monitor, 70));
|
||||
}
|
||||
|
||||
// update and persist scanner configuration
|
||||
CfgSCJobsUtil.updateScannerConfiguration(project, context, instance, buildInfo2, new SubProgressMonitor(monitor, 30));
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.Map.Entry;
|
|||
|
||||
import org.eclipse.cdt.build.core.scannerconfig.CfgInfoContext;
|
||||
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
||||
import org.eclipse.cdt.build.core.scannerconfig.ScannerConfigBuilder;
|
||||
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
|
@ -557,6 +558,11 @@ public class CommonBuilder extends ACBuilder {
|
|||
if(isForeground)
|
||||
updateOtherConfigs(info, builders, kind);
|
||||
|
||||
if (kind == INCREMENTAL_BUILD || kind == FULL_BUILD || kind == AUTO_BUILD) {
|
||||
// Update project model with scanner info
|
||||
ScannerConfigBuilder.build(activeCfg, ScannerConfigBuilder.SKIP_SI_DISCOVERY, new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
|
||||
monitor.done();
|
||||
return refProjects;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue