public static IEnumerable <Func <Tuple <uint, EntryType> > > MapCalcEntryTypeFunc( this IEnumerable <Tuple <uint, string> > source, IValueExtractor valueExtractor, Dictionary <uint, EntryType> entryTypes) { foreach (var(item1, item2) in source) { yield return(() => { var candidates = new List <Tuple <uint, EntryType> > { Tuple.Create(item1, EntryType.Noise()) }; foreach (var pair in entryTypes) { if (valueExtractor.IsMatchSuccess(pair.Value, item2)) { candidates.Add(Tuple.Create <uint, EntryType>(item1, pair.Value)); } } return candidates.OrderBy(x => x.Item2.Priority).First(); }); } }
public static Func <Entry> CreateNewEntryFunc(uint lineNumber, EntryType entryType) { return(() => new Entry(entryType, lineNumber)); }
// ((?!error).)*error[\s|:](?<error>.*) public DataDictionary() { // Project definition // [10:54:44] : [exec] 158>------ Build started: Project: blah x x x, Configuration: Release Win32 ------ definitionMap[EntryType.ProjectDefinition().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + DashesOneOrMore + WhiteSpaceOne + ProjectBuildStarted + Project + ProjectName + AnyZeroOrMore + Comma + WhiteSpaceOne + Configuration + Colon + WhiteSpaceOne + ProjectConfiguration + WhiteSpaceOne + DashesOneOrMore + LineEnd; // Solution start // [10:54:44] : [exec] Build Acceleration Console 8.0.1 (build 1867) definitionMap[EntryType.SolutionStart().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + BuildAccelerationConsole + LineEnd; // Solution end build succeeded // [10:54:44] : [exec] ========== Build: 35 succeeded, 0 failed, 5 up-to-date, 326 skipped ========== definitionMap[EntryType.SolutionEndBuildSucceeded().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + Equals10 + WhiteSpaceOne + Build + Colon + WhiteSpaceOne + BuildSucceeded + Comma + WhiteSpaceOne + BuildFailed + Comma + WhiteSpaceOne + BuildUpToDate + Comma + WhiteSpaceOne + BuildSkipped + WhiteSpaceOne + Equals10 + LineEnd; // Solution end rebuild all succeeded // [10:54:44] : [exec] ========== Rebuild All: 35 succeeded, 0 failed, 326 skipped ========== definitionMap[EntryType.SolutionEndRebuildSucceeded().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + Equals10 + WhiteSpaceOne + ReBuild + Colon + WhiteSpaceOne + BuildSucceeded + Comma + WhiteSpaceOne + BuildFailed + Comma + WhiteSpaceOne + BuildSkipped + WhiteSpaceOne + Equals10 + LineEnd; // Project entry type // [10:53:29] : [exec] 44> blah blah blah definitionMap[EntryType.ProjectEntry().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + ProjectLineData + LineEnd; // Project entry empty type // [10:53:29] : [exec] 44> definitionMap[EntryType.ProjectEmptyEntry().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + LineEnd; // Project end entry // [19:07:17] : [exec] 54>Time Elapsed 00:00:14.56 definitionMap[EntryType.ProjectEndEntry().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + TimeElapsed + LineEnd; // Project build failed // [19:07:17] : [exec] 27>Build FAILED. definitionMap[EntryType.ProjectBuildFailedEntry().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + ProjectBuildFailed + LineEnd; // Project build succeeded // [19:07:17] : [exec] 27>Build succeeded. definitionMap[EntryType.ProjectBuildSucceededEntry().Id] = LineStart + Time + WhiteSpaceOne + Colon + WhiteSpaceOneOrMore + Exec + WhiteSpaceOne + ProjectId + Arrow + ProjectBuildSucceeded + LineEnd; // Stage start // [19:07:17]W: Step 1/4: Clean up definitionMap[EntryType.StageStartType().Id] = LineStart + Time + AnySingleCharacter + Colon + WhiteSpaceOne + StageData + Colon + WhiteSpaceOne + StageLabel; // Stage exit // [19:07:17] : [Step 4/4] Process exited with code 0 definitionMap[EntryType.StageExitType().Id] = LineStart + Time + AnySingleCharacter + Colon + WhiteSpaceOneOrMore + OpenSquareBracket + StageData + CloseSquareBracket + WhiteSpaceOne + StageExitCode; // Stage skipped // [11:57:05] : [Step 1/6] Disabled build step this is the label (here) skipped definitionMap[EntryType.StageSkippedType().Id] = LineStart + Time + AnySingleCharacter + Colon + WhiteSpaceOneOrMore + OpenSquareBracket + StageData + CloseSquareBracket + WhiteSpaceOne + StageSkippedData; // Default error // [11:57:05] : [Step 1/6] stuff error more stuff definitionMap[EntryType.DefaultErrorEntry().Id] = LineStart + Time + AnySingleCharacter + Colon + WhiteSpaceOneOrMore + OpenSquareBracket + StageData + CloseSquareBracket + AnyNumberOfCharactersNotError + Error; }
public static Func <IValueExtractor, IDataService, IStageSkippedType> CreateStageSkippedEntryFunc(uint lineNumber) { return((extractor, data) => new StageSkippedEntry(new Entry(EntryType.StageSkippedType(), lineNumber), extractor, data)); }
public static Func <IValueExtractor, IDataService, IProjectEndBuildSucceededEntry> CreateProjectEndBuildSucceededEntryFunc(uint lineNumber) { return((extractor, data) => new ProjectEndBuildSucceededEntry(new Entry(EntryType.ProjectBuildSucceededEntry(), lineNumber), extractor, data)); }
public static Func <IValueExtractor, IDataService, ISolutionEndRebuildSucceededEntry> CreateSolutionEndRebuildSucceededEntryFunc(uint lineNumber) { return((extractor, data) => new SolutionEndRebuildSucceededEntry(new Entry(EntryType.SolutionEndRebuildSucceeded(), lineNumber), extractor, data)); }
public static Func <IValueExtractor, IDataService, IProjectDefinitionEntry> CreateProjectDefinitionEntryFunc(uint lineNumber) { return((extractor, data) => new ProjectDefinitionEntry(new Entry(EntryType.ProjectDefinition(), lineNumber), extractor, data)); }
public static Func <IValueExtractor, IDataService, INoiseEntry> CreateNoiseEntryFunc(uint lineNumber) { return((extractor, data) => new NoiseEntry(new Entry(EntryType.Noise(), lineNumber), extractor, data)); }