Created
July 17, 2014 07:58
-
-
Save sizovs/0bec8d8ccd3e584f6f5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pattern = ~/.*---(.*)$/ | |
def droppables = [] | |
manager.build.logFile.eachLine { line -> | |
matcher = pattern.matcher(line) | |
if(matcher.matches()) { | |
droppables << matcher.group(1) | |
} | |
} | |
pattern = ~/.*<!>(.*)$/ | |
def warnings = [] | |
manager.build.logFile.eachLine { line -> | |
matcher = pattern.matcher(line) | |
if(matcher.matches()) { | |
warnings << matcher.group(1) | |
} | |
} | |
if (droppables.size() > 0 || warnings.size() > 0) { | |
manager.buildUnstable() | |
manager.addWarningBadge("Warning out there! Take a look!") | |
summary = manager.createSummary("warning.gif") | |
} | |
if(droppables.size() > 0) { | |
summary.appendText("There are classes waiting for cleanup:<ul>", false) | |
droppables.each { | |
summary.appendText("<li>$it</li>", false) | |
} | |
summary.appendText("</ul>", false) | |
} | |
if(warnings.size() > 0) { | |
summary.appendText("Warnings:<ul>", false) | |
warnings.each { | |
summary.appendText("<li>$it</li>", false) | |
} | |
summary.appendText("</ul>", false) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment