private void FindOutOutdetedFiles() { TrackCommandLines = false; SkipTaskExecution(); var previousSources = MapSourcesToCommandLines(); var outdatedSources = SourcesCompiled.Select(ConstructSource); var allSources = Sources.Select(ConstructSource).ToList(); var allOutdetedSources = allSources.Where(a => { string cmd; return(!(previousSources.TryGetValue(a.File, out cmd) && cmd == a.CommandLine)); }).Union(outdatedSources, new Cmp()); OutdatedTasks = allOutdetedSources.Select(a => a.Metadata).ToList(); SourcesCompiled = OutdatedTasks.Select(a => GetWorkItems(a).First()).ToArray(); foreach (var task in OutdatedTasks) { SetupTask(task); } sourcesToCommandLines = allSources.ToDictionary(a => a.File, a => a.CommandLine); }
private void CheckCommandLineOutOfDate(bool minimalRebuldFromTracking, List <ITaskItem> taskItems, string sources, TrackedVCToolTaskInterfaceHelper task, string cmdLine, ref bool toBeCompiled, ref bool outOfDateCommandLine) { if ((SourcesCompiled != null && minimalRebuldFromTracking) && SourcesCompiled.Intersect(taskItems.ToArray()).Count() != taskItems.Count) { string existingCmdLine = null; sourcesToCommandLines.TryGetValue(sources, out existingCmdLine); if (existingCmdLine != null) { existingCmdLine = task.ApplyPrecompareCommandFilter(existingCmdLine); } if (existingCmdLine == null || !cmdLine.Equals(existingCmdLine, StringComparison.Ordinal)) { if (existingCmdLine != null && SchedulerVerbose) { Log.LogMessageFromResources("MultiTool.SourceNotMatchCommand", sources); } sourcesToCommandLines[sources] = cmdLine; toBeCompiled = true; outOfDateCommandLine = true; } } else { if (SchedulerVerbose) { Log.LogMessageFromResources("MultiTool.SourceOutOfDate", sources); } sourcesToCommandLines[sources] = cmdLine; toBeCompiled = true; } }