]> source.dussan.org Git - aspectj.git/commitdiff
-timers option, just times top level main() for now
authoraclement <aclement>
Wed, 7 May 2008 00:39:02 +0000 (00:39 +0000)
committeraclement <aclement>
Wed, 7 May 2008 00:39:02 +0000 (00:39 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java

index 2b8653fa060927cfd32feb7d101d4e1d6d7f11d2..ab30a8d0990b40824fab0c00a48cbd54b813d634 100644 (file)
 
 package org.aspectj.ajdt.ajc;
 
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.StringTokenizer;
 
-import org.aspectj.ajdt.internal.core.builder.*;
-import org.aspectj.bridge.*;
-import org.aspectj.util.*;
-import org.aspectj.weaver.Constants;
-import org.aspectj.weaver.Dump;
-import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.ajdt.internal.core.builder.AjBuildConfig;
+import org.aspectj.bridge.CountingMessageHandler;
+import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.IMessageHandler;
+import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.bridge.Message;
+import org.aspectj.bridge.MessageUtil;
+import org.aspectj.bridge.SourceLocation;
+import org.aspectj.bridge.Version;
 import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
 import org.aspectj.org.eclipse.jdt.internal.compiler.batch.Main;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.util.ConfigParser;
+import org.aspectj.util.FileUtil;
+import org.aspectj.util.LangUtil;
+import org.aspectj.weaver.Constants;
+import org.aspectj.weaver.Dump;
+import org.aspectj.weaver.WeaverMessages;
 
 public class BuildArgParser extends Main {
 
@@ -659,6 +678,8 @@ public class BuildArgParser extends Main {
                        } else {
                                showError("-Xajruntimetarget:<level> only supports a target level of 1.2 or 1.5");
                        }
+            } else if (arg.equals("-timers")) {
+                // swallow - it is dealt with in Main.runMain()
             } else if (arg.equals("-1.5")) {
                buildConfig.setBehaveInJava5Way(true);
                unparsedArgs.add("-1.5");
index 9f0c8b9a01929ac3000c4974403a5018235999e2..77d8bc0dd81649fa001a4bfe956d4027f6c32548 100644 (file)
@@ -19,8 +19,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Arrays;
-import java.util.List;
 import java.util.Date;
+import java.util.List;
 
 import org.aspectj.ajdt.internal.core.builder.AjBuildManager;
 import org.aspectj.bridge.AbortException;
@@ -230,6 +230,7 @@ public class Main {
         // Urk - default no check for AJDT, enabled here for Ant, command-line
         AjBuildManager.enableRuntimeVersionCheck(this);
         final boolean verbose = flagInArgs("-verbose", args);
+        final boolean timers = flagInArgs("-timers", args);
         if (null == this.clientHolder) {
                this.clientHolder = checkForCustomMessageHolder(args);
         }
@@ -252,6 +253,9 @@ public class Main {
 //             try {Thread.sleep(5000); }catch(Exception e) {}
                run(args, holder);
                long etime = System.currentTimeMillis();
+               if (timers) {
+                   System.out.println("Compiler took "+(etime-stime)+"ms");
+               }
                holder.handleMessage(MessageUtil.info("Compiler took "+(etime-stime)+"ms"));
                // uncomment next line to pause at end (keeps jconsole alive!)
 //             try { System.in.read(); } catch (Exception e) {}