]> source.dussan.org Git - vaadin-framework.git/commitdiff
Moved WidgetsetCompiler and avoid GWT warning in it
authorHenri Sara <henri.sara@itmill.com>
Tue, 19 May 2009 07:49:19 +0000 (07:49 +0000)
committerHenri Sara <henri.sara@itmill.com>
Tue, 19 May 2009 07:49:19 +0000 (07:49 +0000)
svn changeset:7870/svn branch:6.0

src/com/vaadin/launcher/WidgetsetCompiler.java [deleted file]
src/com/vaadin/tools/WidgetsetCompiler.java [new file with mode: 0644]

diff --git a/src/com/vaadin/launcher/WidgetsetCompiler.java b/src/com/vaadin/launcher/WidgetsetCompiler.java
deleted file mode 100644 (file)
index 09dfce3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.vaadin.launcher;\r
-\r
-import java.lang.reflect.Method;\r
-\r
-/**\r
- * A wrapper for the GWT 1.6 compiler that runs the compiler in a new thread.\r
- * \r
- * This allows circumventing a J2SE 5.0 bug (6316197) that prevents setting the\r
- * stack size for the main thread. Thus, larger widgetsets can be compiled.\r
- * \r
- * This class takes the same command line arguments as the\r
- * com.google.gwt.dev.GWTCompiler class. The old and deprecated compiler is used\r
- * for compatibility with GWT 1.5.\r
- * \r
- * A typical invocation would use e.g. the following arguments\r
- * \r
- * "-out WebContent/VAADIN/widgetsets com.vaadin.terminal.gwt.DefaultWidgetSet"\r
- * \r
- * In addition, larger memory usage settings for the VM should be used, e.g.\r
- * \r
- * "-Xms256M -Xmx512M -Xss8M"\r
- * \r
- * The source directory containing widgetset and related classes must be\r
- * included in the classpath, as well as the gwt-dev-[platform].jar and other\r
- * relevant JARs.\r
- */\r
-public class WidgetsetCompiler {\r
-\r
-    /**\r
-     * @param args\r
-     *            same arguments as for com.google.gwt.dev.Compiler\r
-     */\r
-    public static void main(final String[] args) {\r
-        try {\r
-            // run the compiler in a different thread to enable using the\r
-            // user-set stack size\r
-\r
-            // on Windows, the default stack size is too small for the main\r
-            // thread and cannot be changed in JRE 1.5 (see\r
-            // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)\r
-\r
-            Runnable runCompiler = new Runnable() {\r
-                public void run() {\r
-                    try {\r
-                        // GWTCompiler.main(args);\r
-                        Class<?> compilerClass = Class\r
-                                .forName("com.google.gwt.dev.GWTCompiler");\r
-                        Method method = compilerClass.getDeclaredMethod("main",\r
-                                String[].class);\r
-                        method.invoke(null, new Object[] { args });\r
-                    } catch (Throwable thr) {\r
-                        thr.printStackTrace();\r
-                    }\r
-                }\r
-            };\r
-            Thread runThread = new Thread(runCompiler);\r
-            runThread.start();\r
-            runThread.join();\r
-            System.out.println("Widgetset compilation finished");\r
-        } catch (Throwable thr) {\r
-            thr.printStackTrace();\r
-        }\r
-    }\r
-}\r
diff --git a/src/com/vaadin/tools/WidgetsetCompiler.java b/src/com/vaadin/tools/WidgetsetCompiler.java
new file mode 100644 (file)
index 0000000..0421164
--- /dev/null
@@ -0,0 +1,66 @@
+package com.vaadin.tools;\r
+\r
+import java.lang.reflect.Method;\r
+\r
+/**\r
+ * A wrapper for the GWT 1.6 compiler that runs the compiler in a new thread.\r
+ * \r
+ * This allows circumventing a J2SE 5.0 bug (6316197) that prevents setting the\r
+ * stack size for the main thread. Thus, larger widgetsets can be compiled.\r
+ * \r
+ * This class takes the same command line arguments as the\r
+ * com.google.gwt.dev.GWTCompiler class. The old and deprecated compiler is used\r
+ * for compatibility with GWT 1.5.\r
+ * \r
+ * A typical invocation would use e.g. the following arguments\r
+ * \r
+ * "-out WebContent/VAADIN/widgetsets com.vaadin.terminal.gwt.DefaultWidgetSet"\r
+ * \r
+ * In addition, larger memory usage settings for the VM should be used, e.g.\r
+ * \r
+ * "-Xms256M -Xmx512M -Xss8M"\r
+ * \r
+ * The source directory containing widgetset and related classes must be\r
+ * included in the classpath, as well as the gwt-dev-[platform].jar and other\r
+ * relevant JARs.\r
+ */\r
+public class WidgetsetCompiler {\r
+\r
+    /**\r
+     * @param args\r
+     *            same arguments as for com.google.gwt.dev.Compiler\r
+     */\r
+    public static void main(final String[] args) {\r
+        try {\r
+            // run the compiler in a different thread to enable using the\r
+            // user-set stack size\r
+\r
+            // on Windows, the default stack size is too small for the main\r
+            // thread and cannot be changed in JRE 1.5 (see\r
+            // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)\r
+\r
+            Runnable runCompiler = new Runnable() {\r
+                public void run() {\r
+                    try {\r
+                        // GWTCompiler.main(args);\r
+                        // avoid warnings\r
+                        System.setProperty("gwt.nowarn.legacy.tools", "true");\r
+                        Class<?> compilerClass = Class\r
+                                .forName("com.google.gwt.dev.GWTCompiler");\r
+                        Method method = compilerClass.getDeclaredMethod("main",\r
+                                String[].class);\r
+                        method.invoke(null, new Object[] { args });\r
+                    } catch (Throwable thr) {\r
+                        thr.printStackTrace();\r
+                    }\r
+                }\r
+            };\r
+            Thread runThread = new Thread(runCompiler);\r
+            runThread.start();\r
+            runThread.join();\r
+            System.out.println("Widgetset compilation finished");\r
+        } catch (Throwable thr) {\r
+            thr.printStackTrace();\r
+        }\r
+    }\r
+}\r