Author: [email protected]
Date: Wed Mar  4 15:19:57 2009
New Revision: 4932

Modified:
    releases/1.6/dev/core/src/com/google/gwt/dev/GWTCompiler.java
    releases/1.6/dev/core/src/com/google/gwt/dev/GWTShell.java
    releases/1.6/dev/core/src/com/google/gwt/util/tools/ToolBase.java

Log:
Add a JVM arg to disable warning on legacy tools.

Modified: releases/1.6/dev/core/src/com/google/gwt/dev/GWTCompiler.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/dev/GWTCompiler.java       
(original)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/GWTCompiler.java       Wed Mar 
  
4 15:19:57 2009
@@ -29,6 +29,7 @@
  import com.google.gwt.dev.util.arg.ArgHandlerLocalWorkers;
  import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
  import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional;
+import com.google.gwt.util.tools.ToolBase;
  import com.google.gwt.util.tools.Utility;

  import java.io.File;
@@ -98,9 +99,8 @@
    }

    public static void main(String[] args) {
-    System.err.println("WARNING: '" + GWTCompiler.class.getName()
-        + "' is deprecated and will be removed in a future release.");
-    System.err.println("Use '" + Compiler.class.getName() + "' instead.");
+    ToolBase.legacyWarn(GWTCompiler.class, Compiler.class);
+
      /*
       * NOTE: main always exits with a call to System.exit to terminate any
       * non-daemon threads that were started in Generators. Typically, this  
is to

Modified: releases/1.6/dev/core/src/com/google/gwt/dev/GWTShell.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/dev/GWTShell.java  (original)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/GWTShell.java  Wed Mar  4  
15:19:57 2009
@@ -27,6 +27,7 @@
  import com.google.gwt.dev.util.Util;
  import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
  import com.google.gwt.util.tools.ArgHandlerExtra;
+import com.google.gwt.util.tools.ToolBase;

  import java.io.File;

@@ -125,9 +126,8 @@
    }

    public static void main(String[] args) {
-    System.err.println("WARNING: '" + GWTShell.class.getName()
-        + "' is deprecated and will be removed in a future release.");
-    System.err.println("Use '" + HostedMode.class.getName() + "'  
instead.");
+    ToolBase.legacyWarn(GWTShell.class, HostedMode.class);
+
      /*
       * NOTE: main always exits with a call to System.exit to terminate any
       * non-daemon threads that were started in Generators. Typically, this  
is to

Modified: releases/1.6/dev/core/src/com/google/gwt/util/tools/ToolBase.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/util/tools/ToolBase.java    
(original)
+++ releases/1.6/dev/core/src/com/google/gwt/util/tools/ToolBase.java   Wed  
Mar  4 15:19:57 2009
@@ -48,6 +48,8 @@
   */
  public abstract class ToolBase {

+  private static final String PROPERTY_NOWARN_LEGACY_TOOLS  
= "gwt.nowarn.legacy.tools";
+
    static {
      String installPath = Utility.getInstallPath();
      try {
@@ -57,6 +59,16 @@
        // ignore problems, failures will occur when the libs try to load
      }
      System.setProperty("swt.library.path", installPath + '/');
+  }
+
+  public static void legacyWarn(Class<?> legacy, Class<?> replacement) {
+    if (System.getProperty(PROPERTY_NOWARN_LEGACY_TOOLS) == null) {
+      System.err.println("WARNING: '" + legacy.getName()
+          + "' is deprecated and will be removed in a future release.");
+      System.err.println("Use '" + replacement.getName() + "' instead.");
+      System.err.println("(To disable this warning, pass -D"
+          + PROPERTY_NOWARN_LEGACY_TOOLS + " as a JVM arg.)");
+    }
    }

    /**

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to