private static ComponentContainer ImportExternalComponents(ComponentConfiguration configuration)
{
if (!configuration.IncludeComponents) {
return new ComponentContainer ();
}
try {
var importer = new ComponentImporter ();
var components = importer.ImportComponents (configuration.ComponentPath);
Console.WriteLine ("Components:");
Console.WriteLine (" Found " + components.AstVisitors.Count + " visitors.");
Console.WriteLine (" Found " + components.BlockAnalyzers.Count + " block analyzers.");
Console.WriteLine (" Found " + components.VulnerabilityReporters.Count + " reporters.");
return components;
} catch (DirectoryNotFoundException) {
Console.WriteLine ("EXTERNAL COMPONENTS ERROR: ");
Console.WriteLine ("Could not find specified component folder (" + configuration.ComponentPath + "). Please make sure to set the correct folder in the config file.");
Environment.Exit (1);
return null;
}
}