summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2009-05-05 10:54:22 +0000
committerHenri Sara <henri.sara@itmill.com>2009-05-05 10:54:22 +0000
commit4f721b98fdd50c7557d10909b815fdf4c32a96dc (patch)
tree5ff434e7e53ad7e644d965ae2f0d52f14638849b /src
parent692c7ab362de6e0621b8099bb10bbbf79f6ddd3c (diff)
downloadvaadin-framework-4f721b98fdd50c7557d10909b815fdf4c32a96dc.tar.gz
vaadin-framework-4f721b98fdd50c7557d10909b815fdf4c32a96dc.zip
#2891: wrapper for GWT compiler to enable compiling widgetsets using GWT 1.6 and JDK 1.5 on Windows
svn changeset:7621/svn branch:6.0
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/launcher/WidgetsetCompiler.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/launcher/WidgetsetCompiler.java b/src/com/itmill/toolkit/launcher/WidgetsetCompiler.java
new file mode 100644
index 0000000000..dd782f5080
--- /dev/null
+++ b/src/com/itmill/toolkit/launcher/WidgetsetCompiler.java
@@ -0,0 +1,54 @@
+package com.itmill.toolkit.launcher;
+
+import com.google.gwt.dev.Compiler;
+
+/**
+ * A wrapper for the GWT 1.6 compiler that runs the compiler in a new thread.
+ *
+ * This allows circumventing a J2SE 5.0 bug (6316197) that prevents setting the
+ * stack size for the main thread. Thus, larger widgetsets can be compiled.
+ *
+ * This class takes the same command line arguments as the
+ * com.google.gwt.dev.Compiler class.
+ *
+ * A typical invocation would use e.g. the following arguments
+ *
+ * "-workDir WebContent/ITMILL/widgetsets com.itmill.toolkit.terminal.gwt.DefaultWidgetSet"
+ *
+ * In addition, larger memory usage settings for the VM should be used, e.g.
+ *
+ * "-Xms256M -Xmx512M -Xss8M"
+ *
+ * The source directory containing widgetset and related classes must be
+ * included in the classpath, as well as the gwt-dev-[platform].jar and other
+ * relevant JARs.
+ */
+public class WidgetsetCompiler {
+
+ /**
+ * @param args
+ * same arguments as for com.google.gwt.dev.Compiler
+ */
+ public static void main(final String[] args) {
+ try {
+ // run the compiler in a different thread to enable using the
+ // user-set stack size
+
+ // on Windows, the default stack size is too small for the main
+ // thread and cannot be changed in JRE 1.5 (see
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)
+
+ Runnable runCompiler = new Runnable() {
+ public void run() {
+ Compiler.main(args);
+ }
+ };
+ Thread runThread = new Thread(runCompiler);
+ runThread.start();
+ runThread.join();
+ System.out.println("Widgetset compilation finished");
+ } catch (Throwable thr) {
+ thr.printStackTrace();
+ }
+ }
+}