Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-6971] Added optional ant task prefix to regexp.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Dec 1, 2011
1 parent 7a63d66 commit be59fc0
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/warnings/WarningsPublisher.java
Expand Up @@ -123,14 +123,14 @@ public WarningsPublisher(final String healthy, final String unHealthy, final Str
final String unstableNewAll, final String unstableNewHigh, final String unstableNewNormal, final String unstableNewLow,
final String failedTotalAll, final String failedTotalHigh, final String failedTotalNormal, final String failedTotalLow,
final String failedNewAll, final String failedNewHigh, final String failedNewNormal, final String failedNewLow,
final boolean canRunOnFailed, final boolean shouldDetectModules,
final boolean canRunOnFailed, final boolean shouldDetectModules, final boolean canComputeNew,
final String includePattern, final String excludePattern) {
super(healthy, unHealthy, thresholdLimit, defaultEncoding, useDeltaValues,
unstableTotalAll, unstableTotalHigh, unstableTotalNormal, unstableTotalLow,
unstableNewAll, unstableNewHigh, unstableNewNormal, unstableNewLow,
failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow,
failedNewAll, failedNewHigh, failedNewNormal, failedNewLow,
canRunOnFailed, shouldDetectModules, PLUGIN_NAME);
canRunOnFailed, shouldDetectModules, canComputeNew, PLUGIN_NAME);
this.includePattern = StringUtils.stripToNull(includePattern);
this.excludePattern = StringUtils.stripToNull(excludePattern);
}
Expand Down
Expand Up @@ -14,7 +14,7 @@ public class AntJavacParser extends RegexpLineParser {
static final String WARNING_TYPE = "Java Compiler";
/** Pattern of javac compiler warnings.
*/
private static final String ANT_JAVAC_WARNING_PATTERN = "^\\s*(?:\\[.*\\])?\\s*(.*java):(\\d*):\\s*(?:warning|\u8b66\u544a)\\s*:\\s*(?:\\[(\\w*)\\])?\\s*(.*)$"
private static final String ANT_JAVAC_WARNING_PATTERN = ANT_TASK + "\\s*(.*java):(\\d*):\\s*(?:warning|\u8b66\u544a)\\s*:\\s*(?:\\[(\\w*)\\])?\\s*(.*)$"
+ "|^\\s*\\[.*\\]\\s*warning.*\\]\\s*(.*\"(.*)\".*)$";
// \u8b66\u544a is Japanese l10n

Expand Down
Expand Up @@ -56,7 +56,7 @@ public class DoxygenParser extends RegexpDocumentParser {
* (.+(?:\\n[^/<\\n][^:\\n][^\\\\\\n].+)*
* */
private static final String DOXYGEN_WARNING_PATTERN =
"^(?:(?:((?:[/.]|[A-Za-z]:).+?):(-?\\d+):\\s*([Ww]arning|[Ee]rror)|<.+>:-?\\d+(?::\\s*([Ww]arning|[Ee]rror))?): (.+(?:\\n[^/<\\n][^:\\n][^/\\n].+)*)|\\s*([Nn]otice|[Ww]arning|[Ee]rror): (.+))$";
ANT_TASK + "(?:(?:((?:[/.]|[A-Za-z]:).+?):(-?\\d+):\\s*([Ww]arning|[Ee]rror)|<.+>:-?\\d+(?::\\s*([Ww]arning|[Ee]rror))?): (.+(?:\\n[^/<\\n][^:\\n][^/\\n].+)*)|\\s*([Nn]otice|[Ww]arning|[Ee]rror): (.+))$";

/** The index of the regexp group capturing the file name (when the warning occurs in a file). */
private static final int FILE_NAME_GROUP = 1;
Expand Down
Expand Up @@ -16,7 +16,7 @@ public class Gcc4CompilerParser extends RegexpLineParser {
/** Warning type of this parser. */
static final String WARNING_TYPE = "gcc4";
/** Pattern of gcc 4 compiler warnings. */
private static final String GCC_WARNING_PATTERN = "^(?:\\s*\\[.*\\]\\s*)?(.+?):(\\d+):(?:\\d+:)? (warning|error): (.*)$";
private static final String GCC_WARNING_PATTERN = ANT_TASK + "(.+?):(\\d+):(?:\\d+:)? (warning|error): (.*)$";

/**
* Creates a new instance of <code>Gcc4CompilerParser</code>.
Expand Down
Expand Up @@ -15,7 +15,7 @@ public class MsBuildParser extends RegexpLineParser {
/** Warning type of this parser. */
static final String WARNING_TYPE = "MSBuild";
/** Pattern of MSBuild compiler warnings. */
private static final String MS_BUILD_WARNING_PATTERN = "^(?:.*\\[.*\\])?(?:\\s*\\d+>)?(?:(?:(?:(.*)\\((\\d*).*\\)|.*LINK)\\s*:|(.*):)\\s*([Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror)\\s*:?\\s*([A-Za-z0-9]+):\\s*(.*)|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*))$";
private static final String MS_BUILD_WARNING_PATTERN = ANT_TASK + "(?:\\s*\\d+>)?(?:(?:(?:(.*)\\((\\d*).*\\)|.*LINK)\\s*:|(.*):)\\s*([Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror)\\s*:?\\s*([A-Za-z0-9]+):\\s*(.*)|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*))$";

/**
* Creates a new instance of <code>MsBuildParser</code>.
Expand Down
Expand Up @@ -21,6 +21,8 @@ public abstract class RegexpParser implements WarningsParser {
protected static final String DEPRECATION = "Deprecation";
/** Warning classification. */
protected static final String PROPRIETARY_API = "Proprietary API";
/** Pattern identifying an ant task debug output prefix. */
protected static final String ANT_TASK = "^(?:.*\\[.*\\])?\\s*";
/** Pattern of compiler warnings. */
private final Pattern pattern;
/** Name of this parser. */
Expand Down
Expand Up @@ -154,7 +154,7 @@ public void issue3866() throws IOException {
ParserRegistry parserRegistry = createRegistryUnderTest(FILE_NAME, "/tmp/clover*/**", StringUtils.EMPTY, new ArrayList<WarningsParser>());

Collection<FileAnnotation> annotations = parserRegistry.parse(DUMMY_FILE);
Assert.assertEquals(WRONG_NUMBER_OF_ANNOTATIONS_PARSED, 16, annotations.size());
Assert.assertEquals(WRONG_NUMBER_OF_ANNOTATIONS_PARSED, 17, annotations.size());
}

/**
Expand Down
@@ -1,8 +1,8 @@
/home/user/myproject/helper/LCPcalc.cpp:479:warning: the name `lcp_lexicolemke.c' supplied as the second argument in the \file statement is not an input file
/home/user/myproject/helper/SimpleTimer.h:19:error: Unexpected character `"'

.../XmlParser.h:357: warning: Member getInternalParser() (function) of class XmlParser is not documented.
[exec] .../XmlParser.h:357: warning: Member getInternalParser() (function) of class XmlParser is not documented.

P:/Integration/DjRip/djrip/workspace/libraries/xml/XmlMemoryEntityResolver.h:39: warning: Member XmlMemoryEntityMapEntry (typedef) of class XmlMemoryEntityResolver is not documented.
[exec] P:/Integration/DjRip/djrip/workspace/libraries/xml/XmlMemoryEntityResolver.h:39: warning: Member XmlMemoryEntityMapEntry (typedef) of class XmlMemoryEntityResolver is not documented.


0 comments on commit be59fc0

Please sign in to comment.