tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

MSBuildLogParser does not support installations of MsBuild on x64 Windows #182

Closed arontsang closed 1 year ago

arontsang commented 1 year ago

Error:

[2023-09-14T05:43:02.103Z] java.lang.NumberFormatException: For input string: "x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2364"
[2023-09-14T05:43:02.103Z]  at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
[2023-09-14T05:43:02.103Z]  at java.base/java.lang.Integer.parseInt(Integer.java:652)
[2023-09-14T05:43:02.103Z]  at java.base/java.lang.Integer.parseInt(Integer.java:770)
[2023-09-14T05:43:02.103Z]  at se.bjurr.violations.lib.parsers.MSBuildLogParser.parseReportOutput(MSBuildLogParser.java:34)
[2023-09-14T05:43:02.103Z]  at se.bjurr.violations.lib.reports.ViolationsFinder.findViolations(ViolationsFinder.java:35)
[2023-09-14T05:43:02.103Z]  at se.bjurr.violations.lib.ViolationsApi.violations(ViolationsApi.java:106)

Seems to be clear that the regex in MSBuildLogParser:29 is matching on the ( from (x86) from Program Files (x86), which is in the default installation path of MsBuild.