<?xml version='1.0' encoding='UTF-8'?>
<hudson.plugins.warnings.WarningsDescriptor>
  <groovyParsers>
    <hudson.plugins.warnings.GroovyParser>
      <name>Warnings</name>
      <regexp>^\b[a-zA-Z]\:\\(?:[^\\/:*?&quot;&lt;&gt;]+\\)*(Delphi|Install|workspace\\_Precompiled\\Build\.xml|workspace\\Build\.xml)[\W\w]+?\:\s+(warning|error)\s(?:(?:\:\s(?:\b[a-zA-Z]\:\\[^\/:*?&quot;&lt;&gt;]+\\)*)?([\s\w\d\.-]+\.[\w\d]{2,}))?(?:\((\d+)\)\s)?(?:\:\ )?([Ee]rror|[Ww]arning|[Ff]atal|[Hh]int)?(?:\:?\s)?(\w\d+|MSB[\d]+|)[\s\:]{1,2}([\w\s\W\S]+?)(?:\[\b[a-zA-Z]\:\\(?:[^\\/:*?&quot;&lt;&gt;]+\\)+workspace\\([^\/:*?&quot;&lt;&gt;]+)\\[^\\/:*?&quot;&lt;&gt;]+)?$</regexp>
      <script>import java.util.regex.Matcher;&#xd;
import java.util.regex.Pattern;&#xd;
import org.apache.commons.lang.StringUtils;&#xd;
import hudson.plugins.analysis.util.model.Priority;&#xd;
import hudson.plugins.warnings.parser.Warning;&#xd;
&#xd;
// variables&#xd;
String TaskName = matcher.group(1)&#xd;
String category = matcher.group(2)&#xd;
String fileName = &quot;&quot; &#xd;
Integer lineNumber = 0&#xd;
String WarningType = matcher.group(5)&#xd;
String type = matcher.group(6)&#xd;
String message = matcher.group(7)&#xd;
//String PackageName = matcher.group(8)&#xd;
&#xd;
// имя файла может отсутствовать в строке лога&#xd;
if(StringUtils.isNotBlank(matcher.group(3)))&#xd;
{&#xd;
     fileName = matcher.group(3);&#xd;
};&#xd;
&#xd;
&#xd;
// номера строки может и не быть&#xd;
if(StringUtils.isNotBlank(matcher.group(4)))&#xd;
     try&#xd;
     {&#xd;
          lineNumber = Integer.parseInt(matcher.group(4));&#xd;
     }&#xd;
     catch(NumberFormatException exception) { };&#xd;
&#xd;
if (StringUtils.containsIgnoreCase(TaskName, &quot;workspace&quot;))&#xd;
{&#xd;
      fileName = TaskName.replace(&quot;workspace&quot;, &quot;{root}&quot;);&#xd;
      TaskName = &quot;MSBuild&quot;;&#xd;
      WarningType = category;&#xd;
}&#xd;
&#xd;
//Set Category &#xd;
category = &quot;(&quot; + TaskName + &quot;): &quot; + WarningType;&#xd;
&#xd;
// Detect Priority&#xd;
Priority priority;&#xd;
&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Hint&quot;))&#xd;
   priority = Priority.LOW;&#xd;
else&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Error&quot;) || StringUtils.containsIgnoreCase(category, &quot;Fatal&quot;))&#xd;
   priority = Priority.HIGH;&#xd;
else&#xd;
   priority = Priority.NORMAL;&#xd;
&#xd;
//Set detailed Type&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Delphi&quot;))&#xd;
{&#xd;
    type = type + &quot; &quot; + Pattern.compile(&quot;\\&apos;.+?\\&apos;&quot;).matcher(message).replaceAll(&quot;&apos;%s&apos;&quot;)&#xd;
}&#xd;
&#xd;
Warning warning = new Warning(fileName, lineNumber, type, category, message, priority);&#xd;
&#xd;
// пробуем установить имя пакета&#xd;
if(StringUtils.isNotBlank(matcher.group(8)))&#xd;
{&#xd;
   warning.setPackageName(matcher.group(8));&#xd;
}&#xd;
&#xd;
&#xd;
return warning;&#xd;
</script>
    </hudson.plugins.warnings.GroovyParser>
    <hudson.plugins.warnings.GroovyParser>
      <name>CTI_Warnings_Full</name>
      <regexp>^\b[a-zA-Z]\:\\(?:[^\\/:*?&quot;&lt;&gt;]+\\)*(Delphi|Install|workspace\\_Precompiled\\Build\.xml|workspace\\Build\.xml)[\W\w]+?\:\s+(warning|error)\s(?:(?:\:\s(?:\b[a-zA-Z]\:\\[^\/:*?&quot;&lt;&gt;]+\\)*)?([\s\w\d\.-]+\.[\w\d]{2,}))?(?:\((\d+)\)\s)?(?:\:\ )?([Ee]rror|[Ww]arning|[Ff]atal|[Hh]int)?(?:\:?\s)?(\w\d+|MSB[\d]+|)[\s\:]{1,2}([\w\s\W\S]+?)(?:\[\b[a-zA-Z]\:\\(?:[^\\/:*?&quot;&lt;&gt;]+\\)+workspace\\([^\/:*?&quot;&lt;&gt;]+)\\[^\\/:*?&quot;&lt;&gt;]+)?$</regexp>
      <script>import java.util.regex.Matcher;&#xd;
import java.util.regex.Pattern;&#xd;
import org.apache.commons.lang.StringUtils;&#xd;
import hudson.plugins.analysis.util.model.Priority;&#xd;
import hudson.plugins.warnings.parser.Warning;&#xd;
&#xd;
// variables&#xd;
String TaskName = matcher.group(1)&#xd;
String category = matcher.group(2)&#xd;
String fileName = &quot;&quot; &#xd;
Integer lineNumber = 0&#xd;
String WarningType = matcher.group(5)&#xd;
String type = matcher.group(6)&#xd;
String message = matcher.group(7)&#xd;
&#xd;
//FileName&#xd;
if(StringUtils.isNotBlank(matcher.group(3)))&#xd;
{&#xd;
     fileName = matcher.group(3);&#xd;
};&#xd;
&#xd;
&#xd;
//LineNumber&#xd;
if(StringUtils.isNotBlank(matcher.group(4)))&#xd;
 try&#xd;
 {&#xd;
   lineNumber = Integer.parseInt(matcher.group(4));&#xd;
 }&#xd;
 catch(NumberFormatException exception) { };&#xd;
&#xd;
if (StringUtils.containsIgnoreCase(TaskName, &quot;workspace&quot;))&#xd;
{&#xd;
   fileName = TaskName.replace(&quot;workspace&quot;, &quot;{root}&quot;);&#xd;
   TaskName = &quot;MSBuild&quot;;&#xd;
   WarningType = category;&#xd;
}&#xd;
&#xd;
//Category &#xd;
category = &quot;(&quot; + TaskName + &quot;): &quot; + WarningType;&#xd;
&#xd;
// Priority&#xd;
Priority priority;&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Hint&quot;))&#xd;
   priority = Priority.LOW;&#xd;
else&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Error&quot;) || StringUtils.containsIgnoreCase(category, &quot;Fatal&quot;))&#xd;
   priority = Priority.HIGH;&#xd;
else&#xd;
   priority = Priority.NORMAL;&#xd;
&#xd;
//Type&#xd;
if (StringUtils.containsIgnoreCase(category, &quot;Delphi&quot;))&#xd;
{&#xd;
  type = type + &quot; &quot; + Pattern.compile(&quot;\\&apos;.+?\\&apos;&quot;).matcher(message).replaceAll(&quot;&apos;%s&apos;&quot;)&#xd;
}&#xd;
&#xd;
Warning warning = new Warning(fileName, lineNumber, type, category, message, priority);&#xd;
&#xd;
//PackageName&#xd;
if(StringUtils.isNotBlank(matcher.group(8)))&#xd;
{&#xd;
   warning.setPackageName(matcher.group(8));&#xd;
}&#xd;
&#xd;
return warning;</script>
    </hudson.plugins.warnings.GroovyParser>
  </groovyParsers>
</hudson.plugins.warnings.WarningsDescriptor>