private static int MainCore(string[] args) { if (args.Length == 0) { Usage(); return(1); } var allGood = true; foreach (var arg in args) { if (SharedUtil.IsSolutionFile(arg)) { allGood &= ProcessSolution(arg); } else if (Path.GetExtension(arg) == ".xml") { allGood &= ProcessStructuredLog(arg); } else { allGood &= ProcessTargets(arg); } } if (!allGood) { Console.WriteLine("Failed"); } return(allGood ? 0 : 1); }
internal bool CheckAll(TextWriter textWriter) { var allGood = true; foreach (var filePath in Directory.GetFiles(_targetDir)) { var fileName = Path.GetFileName(filePath); if (fileName == "README.md") { continue; } textWriter.WriteLine($"Checking {fileName}"); if (SharedUtil.IsPropsFile(filePath)) { allGood &= CheckProps(new ProjectUtil(filePath), textWriter); } else if (SharedUtil.IsTargetsFile(filePath)) { allGood &= CheckTargets(new ProjectUtil(filePath), textWriter); } else if (SharedUtil.IsXslt(filePath)) { // Nothing to verify } else { textWriter.WriteLine("Unrecognized file type"); allGood = false; } } return(allGood); }
internal static int Main(string[] args) { if (args.Length == 0) { Usage(); return(1); } var allGood = true; foreach (var arg in args) { if (SharedUtil.IsSolutionFile(arg)) { allGood &= ProcessSolution(arg); } else if (Path.GetExtension(arg) == ".xml") { allGood &= ProcessStructuredLog(arg); } else { allGood &= ProcessTargets(arg); } } return(allGood ? 0 : 1); }
private bool CheckTargets(ProjectUtil util, TextWriter textWriter) { var allGood = true; foreach (var project in GetImportProjects(util)) { if (SharedUtil.IsPropsFile(project)) { textWriter.WriteLine($"Targets files should not Import props files"); allGood = false; } } return(allGood); }
private bool CheckProps(ProjectUtil util, TextWriter textWriter) { var allGood = true; foreach (var project in GetImportProjects(util)) { if (!SharedUtil.IsPropsFile(project)) { textWriter.WriteLine($"Props files should only Import other props files"); allGood = false; } } if (util.GetTargets().Any()) { textWriter.WriteLine($"Props files should not contain <Target> elements"); allGood = false; } return(allGood); }