package com.semperos.screwdriver;

/**
 * Created with IntelliJ IDEA.
 * User: semperos
 * Date: 2/5/13
 * Time: 4:38 PM
 * To change this template use File | Settings | File Templates.
 */
public class YuiCompressor {
}

@@ -1,221 +1,2467 @@
-package com.semperos.screwdriver;%0A%0A/**%0A * Created with IntelliJ IDEA.%0A * User: semperos%0A * Date: 2/5/13%0A * Time: 4:38 PM%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0Apublic class YuiCompressor %7B
+/**%0A * Borrowed heavily from https://github.com/remear/java-asset-pipeline%0A */%0Apackage com.semperos.screwdriver;%0A%0Aimport com.yahoo.platform.yui.compressor.JavaScriptCompressor;%0Aimport org.mozilla.javascript.ErrorReporter;%0Aimport org.mozilla.javascript.EvaluatorException;%0A%0Aimport java.io.*;%0A%0A/**%0A * Compress JavaScript or CSS using the YUI Compressor%0A */%0Apublic class YuiCompressor %7B%0A    public static void compress(String extension, File inputFile, File outputFile) %7B%0A        try %7B%0A            Reader in = new InputStreamReader(new FileInputStream(inputFile), %22UTF-8%22);%0A            Writer out = new OutputStreamWriter(new FileOutputStream(outputFile), %22UTF-8%22);%0A%0A            if (extension.equals(%22js%22)) %7B%0A                JavaScriptCompressor c = new JavaScriptCompressor(in, new YuiCompressorErrorReporter());%0A                c.compress(out,%0A                        -1,     // lineBreakPos%0A                        true,   // munge?%0A                        false,  // verbose?%0A                        false,  // preserveAllSemicolons?%0A                        false); // disableOptimizations?%0A            %7D%0A        %7D catch (FileNotFoundException e) %7B%0A            e.printStackTrace();%0A        %7D catch (UnsupportedEncodingException e) %7B%0A            e.printStackTrace();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    /**%0A     * @todo Incorporate logging%0A     */%0A    private static class YuiCompressorErrorReporter implements ErrorReporter %7B%0A%0A        @Override%0A        public void warning(String message, String sourceName, int line, String lineSource, int lineOffset) %7B%0A            if (line %3C 0) %7B%0A                System.err.println(message);%0A            %7D else %7B%0A                System.err.println(%22YuiCompressor WARNING: %22 + line + %22:%22 + lineOffset + ':' + message);%0A            %7D%0A        %7D%0A%0A        @Override%0A        public void error(String message, String sourceName, int line, String lineSource, int lineOffset) %7B%0A            if (line %3C 0) %7B%0A                System.err.println(message);%0A            %7D else %7B%0A                System.err.println(%22YuiCompressor ERROR: %22 + line + %22:%22 + lineOffset + ':' + message);%0A            %7D%0A        %7D%0A%0A        @Override%0A        public EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) %7B%0A            error(message, sourceName, line, lineSource, lineOffset);%0A            return new EvaluatorException(message);%0A        %7D%0A    %7D
 %0A%7D%0A

Add initial YUI Compressor utility class