public static MethodMappings createMethodMappings(this string sourceFolder, List <string> references, string resultsFolder, bool runOnSeparateAppDomain)
 {
     "Creating Method Mappings from folder : {0}".info(sourceFolder);
     //var methodFilter = @"";
     //var results =
     MethodMappings_Engine.calculateMethodMappings(sourceFolder, resultsFolder, references, runOnSeparateAppDomain);
     return(resultsFolder.files("*.xml").loadAndMergeMethodMappings());
 }
        public static string calculateMethodMappings(string sourceFolder, string resultsFolder, string methodFilter, bool useCachedData, List <string> references, int numberOfMethodsToProcess, bool runInSeparateAppDomain)
        {
            if (resultsFolder.valid().isFalse())
            {
                resultsFolder = "_AstEngine_MethodMappings".tempDir();
            }
            resultsFolder.createDir();
            var rawResultsFolder = resultsFolder.pathCombine("_PartialMethodMappings");

            rawResultsFolder.createDir();
            var continueScan = true;

            while (continueScan)
            {
                "Executing MethodMappings_Engine for {0} methods".debug(numberOfMethodsToProcess);
                var resultsFile = (runInSeparateAppDomain)
                                                                        ? MethodMappings_Engine.executeEngineOnSeparateAppDomain(sourceFolder, rawResultsFolder, methodFilter, useCachedData, references, numberOfMethodsToProcess)
                                                                        : new MethodMappings_Engine().createMethodMappings(sourceFolder, rawResultsFolder, methodFilter, useCachedData, references, numberOfMethodsToProcess);
                if (resultsFile.isNull())
                {
                    "in calculateMethodMappings Results file was null".error();
                    break;
                }
                else
                if (resultsFile.xRoot().elementsAll().size() < 6)
                {
                    break;
                }
                //"NUMBER OF ELEMENTS:{0}".error(resultsFile.xRoot().elementsAll().size());
            }
            var consolidatedFile = resultsFolder.pathCombine("ConsolidatedMethodMappings_{0}.xml".format(sourceFolder.fileName()));

            if (consolidatedFile.fileExists().isFalse())
            {
                var consolidatedMethodMappings = rawResultsFolder.files("*.xml").loadAndMergeMethodMappings();
                consolidatedMethodMappings.SourceCodeFolder = sourceFolder;
                consolidatedMethodMappings.ResultsFolder    = resultsFolder;
                consolidatedMethodMappings.MethodFilter     = methodFilter;
                consolidatedMethodMappings.References       = references;

                consolidatedMethodMappings.saveMappings(consolidatedFile);
            }
            // create consolidated
            return(resultsFolder);
        }