Parse dotnet build output to find the result and error reports
(output)
| 83 | |
| 84 | |
| 85 | def parse_dotnet_build_output(output): |
| 86 | """Parse dotnet build output to find the result and error reports""" |
| 87 | build_finder = re.compile(r"^Build (success.*|FAIL.*)$") |
| 88 | time_finder = re.compile(r"^Time Elapsed (.+)$") |
| 89 | capture = False |
| 90 | report = "" |
| 91 | for oline in output[0].split("\n"): |
| 92 | if time_finder.match(oline): |
| 93 | break |
| 94 | if capture: |
| 95 | report += f"{oline}\n" |
| 96 | if match := build_finder.match(oline): |
| 97 | if "fail" in match.groups()[0].lower(): |
| 98 | result = False |
| 99 | capture = True |
| 100 | return output[1] == 0, output[0] |
| 101 | |
| 102 | |
| 103 | def ensure_windows(): |