build scripts: log exception caused an error if any

This commit is contained in:
nik
2016-08-04 12:13:32 +03:00
parent b5a37db99c
commit b8214dcc65
3 changed files with 8 additions and 1 deletions
@@ -151,6 +151,8 @@ interface BuildMessages {
*/
void error(String message)
void error(String message, Throwable cause)
void progress(String message)
public <V> V block(String blockName, Closure<V> body)
@@ -55,7 +55,7 @@ class AntTaskLogger implements BuildListener {
BuildMessages handler = threadHandlers[Thread.currentThread()] ?: taskHandlers[event.task?.runtimeConfigurableWrapper] ?: defaultHandler
switch (event.priority) {
case Project.MSG_ERR:
handler.error(message)
handler.error(message, event.exception)
break
case Project.MSG_WARN:
handler.warning(message)
@@ -92,6 +92,11 @@ class BuildMessagesImpl implements BuildMessages {
throw new BuildException(message)
}
@Override
void error(String message, Throwable cause) {
throw new BuildException(message, cause)
}
@Override
void progress(String message) {
if (parentInstance != null) {