cleanup to verbose (-v) code
authoradam <adam@megacz.com>
Mon, 27 Dec 2004 04:29:34 +0000 (04:29 +0000)
committeradam <adam@megacz.com>
Mon, 27 Dec 2004 04:29:34 +0000 (04:29 +0000)
darcs-hash:20041227042934-5007d-412fc488feb5f13d368518e6cb5d99761c020433.gz

src/org/ibex/tool/Compiler.java

index d72d33f..cbee466 100644 (file)
@@ -21,6 +21,8 @@ import org.eclipse.jdt.internal.compiler.env.*;
 import org.eclipse.jdt.internal.compiler.impl.*;
 import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
 
+// FEATURE: add build dependencies like make (grab some Java dependency-checker code off the net?)
+
 public class Compiler {
     // Static Entry Point /////////////////////////////////////////////////////
 
@@ -214,6 +216,7 @@ public class Compiler {
        } catch (Exception e) {
            e.printStackTrace();
        }
+       if (verbose) System.out.print(clearing + "   \r");
     }
 
     private final FilenameFilter filterSrcs = new FilenameFilter() {
@@ -621,7 +624,6 @@ public class Compiler {
             }
 
             ClassFile[] c = result.getClassFiles();
-           String clearing = "\r";
             for (int i=0; i < c.length; i++) {
                 try {
                    char[][] name = c[i].getCompoundName();
@@ -634,9 +636,9 @@ public class Compiler {
                        */
                        String printme = " writing: " + pct + str(pack(name),'.') + "." + new String(name(name));
                        if (clearing.length() < printme.length()) clearing = "";
-                       else clearing = clearing.substring(0, clearing.length() - printme.length());
+                       else clearing = clearing.substring(printme.length());
                        System.out.print(printme + clearing + "\r");
-                       for(clearing = ""; clearing.length() < printme.length() + 2; clearing += " ");
+                       for(clearing = ""; clearing.length() < printme.length() + 5; clearing += " ");
                    }
                    if (buildzip) {
                        try {
@@ -669,6 +671,7 @@ public class Compiler {
     };
 
     int percent = 0;
+    String clearing = "";
 
     /** Problem creater for compiler. */
     private final IProblemFactory problems = new DefaultProblemFactory();