From 76995b0cc6ed883ce0fa43668664997c96908502 Mon Sep 17 00:00:00 2001 From: Derek Nheiley Date: Sat, 6 May 2017 17:54:25 -0300 Subject: [PATCH] add filename and line number details in error output for compressor failures and warnings --- src/java/com/simonbuckle/ant/tasks/CompressTask.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/com/simonbuckle/ant/tasks/CompressTask.java b/src/java/com/simonbuckle/ant/tasks/CompressTask.java index c494cf1..92be713 100644 --- a/src/java/com/simonbuckle/ant/tasks/CompressTask.java +++ b/src/java/com/simonbuckle/ant/tasks/CompressTask.java @@ -106,7 +106,7 @@ public void execute() throws BuildException { } } - private void compress(File source, File dest) throws IOException { + private void compress(final File source, File dest) throws IOException { Reader in = null; Writer out = null; try { @@ -114,11 +114,11 @@ private void compress(File source, File dest) throws IOException { JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() { public void warning(String message, String sourceName, int line, String lineSource, int lineOffset) { - log("Warning: " + message, Project.MSG_WARN); + log("Warning: " + source.getName() + ":" + line + ":" + lineOffset + " " + message + " >>>>" + lineSource, Project.MSG_WARN); } public void error(String message, String sourceName, int line, String lineSource, int lineOffset) { - log("Error: " + message, Project.MSG_ERR); + log("Error: " + source.getName() + ":" + line + ":" + lineOffset + " " + message + " >>>>" + lineSource, Project.MSG_ERR); } public EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) { @@ -128,7 +128,7 @@ public EvaluatorException runtimeError(String message, String sourceName, int li }); out = new BufferedWriter(new FileWriter(dest)); - log("Compressing: " + source.getName()); + log("Compressing: " + source.getName() + " ===> " + dest.getName()); compressor.compress(out, linebreak, @@ -149,7 +149,7 @@ private void compressCss(File source, File dest) throws IOException { in = new BufferedReader(new FileReader(source)); CssCompressor compressor = new CssCompressor(in); - log("Compressing: " + source.getName()); + log("Compressing: " + source.getName() + " ===> " + dest.getName()); out = new BufferedWriter(new FileWriter(dest)); compressor.compress(out, linebreak);