Author: [email protected]
Date: Tue Mar 10 18:42:26 2009
New Revision: 4980

Added:
    releases/1.6/dev/core/src/com/google/gwt/dev/RunWebApp.java   (contents,  
props changed)
    releases/1.6/tools/benchmark-viewer/war/
    releases/1.6/tools/benchmark-viewer/war/ReportViewer.css
       - copied unchanged from r4963,  
/releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.css
    releases/1.6/tools/benchmark-viewer/war/ReportViewer.html
       - copied, changed from r4963,  
/releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.html
    releases/1.6/tools/benchmark-viewer/war/WEB-INF/
    releases/1.6/tools/benchmark-viewer/war/WEB-INF/classes/
    releases/1.6/tools/benchmark-viewer/war/WEB-INF/classes/marker
    releases/1.6/tools/benchmark-viewer/war/WEB-INF/web.xml   (contents,  
props changed)
Removed:
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.css
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.html
    releases/1.6/tools/benchmark-viewer/test/
Modified:
    releases/1.6/dev/core/src/com/google/gwt/dev/HostedModeBase.java
    releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java
    releases/1.6/distro-source/linux/build.xml
    releases/1.6/distro-source/linux/src/benchmarkViewer
    releases/1.6/distro-source/mac/build.xml
    releases/1.6/distro-source/mac/src/benchmarkViewer
    releases/1.6/distro-source/windows/build.xml
    releases/1.6/distro-source/windows/src/benchmarkViewer.cmd
    releases/1.6/eclipse/tools/benchmark-viewer/   (props changed)
    releases/1.6/eclipse/tools/benchmark-viewer/.classpath
    releases/1.6/eclipse/tools/benchmark-viewer/.project
    releases/1.6/tools/benchmark-viewer/build.xml
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/ReportViewer.gwt.xml
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportServer.java
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportViewer.java
     
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/server/ReportImageServer.java

Log:
Updates BenchmarkViewer to 1.6 style.  It's now launched through the new  
RunWebApp command-line tool.

Suggested by: bruce
Review by: jgw

Modified: releases/1.6/dev/core/src/com/google/gwt/dev/HostedModeBase.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/dev/HostedModeBase.java     
(original)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/HostedModeBase.java    Tue  
Mar 10 18:42:26 2009
@@ -322,6 +322,27 @@
      }
    }

+  public static String normalizeURL(String unknownUrlText, int port,  
String host) {
+    if (unknownUrlText.indexOf(":") != -1) {
+      // Assume it's a full url.
+      return unknownUrlText;
+    }
+
+    // Assume it's a trailing url path.
+    if (unknownUrlText.length() > 0 && unknownUrlText.charAt(0) == '/') {
+      unknownUrlText = unknownUrlText.substring(1);
+    }
+
+    if (port != 80) {
+      // CHECKSTYLE_OFF: Not really an assembled error message, so no space
+      // after ':'.
+      return "http://"; + host + ":" + port + "/" + unknownUrlText;
+      // CHECKSTYLE_ON
+    } else {
+      return "http://"; + host + "/" + unknownUrlText;
+    }
+  }
+
    protected final HostedModeBaseOptions options;

    /**
@@ -363,26 +384,7 @@
    public abstract void launchStartupUrls(final TreeLogger logger);

    public final String normalizeURL(String unknownUrlText) {
-    if (unknownUrlText.indexOf(":") != -1) {
-      // Assume it's a full url.
-      return unknownUrlText;
-    }
-
-    // Assume it's a trailing url path.
-    if (unknownUrlText.length() > 0 && unknownUrlText.charAt(0) == '/') {
-      unknownUrlText = unknownUrlText.substring(1);
-    }
-
-    int port = getPort();
-    String host = getHost();
-    if (port != 80) {
-      // CHECKSTYLE_OFF: Not really an assembled error message, so no space
-      // after ':'.
-      return "http://"; + host + ":" + port + "/" + unknownUrlText;
-      // CHECKSTYLE_ON
-    } else {
-      return "http://"; + host + "/" + unknownUrlText;
-    }
+    return normalizeURL(unknownUrlText, getPort(), getHost());
    }

    /**

Added: releases/1.6/dev/core/src/com/google/gwt/dev/RunWebApp.java
==============================================================================
--- (empty file)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/RunWebApp.java Tue Mar 10  
18:42:26 2009
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.ServletContainer;
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.dev.HostedModeBase.OptionPort;
+import com.google.gwt.dev.HostedModeBase.OptionStartupURLs;
+import com.google.gwt.dev.shell.BrowserWidget;
+import com.google.gwt.dev.shell.jetty.JettyLauncher;
+import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.util.tools.ArgHandlerExtra;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * An experimental class for running web apps.
+ */
+public class RunWebApp {
+
+  interface RunWebAppOptions extends OptionStartupURLs, OptionPort {
+  }
+
+  static class RunWebAppOptionsImpl implements RunWebAppOptions {
+    private int port;
+    private final List<String> startupURLs = new ArrayList<String>();
+
+    public void addStartupURL(String url) {
+      startupURLs.add(url);
+    }
+
+    public int getPort() {
+      return port;
+    }
+
+    public List<String> getStartupURLs() {
+      return Collections.unmodifiableList(startupURLs);
+    }
+
+    public void setPort(int port) {
+      this.port = port;
+    }
+  }
+
+  private class ArgHandlerWar extends ArgHandlerExtra {
+    @Override
+    public boolean addExtraArg(String arg) {
+      warFile = new File(arg);
+      if (!warFile.exists()) {
+        System.err.println("Could not open war file '"
+            + warFile.getAbsolutePath() + "'");
+        return false;
+      }
+      return true;
+    }
+
+    @Override
+    public String getPurpose() {
+      return "Specifies the name(s) of the module(s)";
+    }
+
+    @Override
+    public String[] getTagArgs() {
+      return new String[] {"module[s]"};
+    }
+
+    @Override
+    public boolean isRequired() {
+      return true;
+    }
+  }
+
+  private class ArgProcessor extends ArgProcessorBase {
+    public ArgProcessor(RunWebAppOptions options) {
+      registerHandler(new HostedMode.ArgHandlerStartupURLs(options));
+      registerHandler(new HostedModeBase.ArgHandlerPort(options));
+      registerHandler(new ArgHandlerWar());
+    }
+
+    @Override
+    protected String getName() {
+      return RunWebApp.class.getName();
+    }
+  }
+
+  public static void main(String[] args) {
+    try {
+      RunWebAppOptionsImpl options = new RunWebAppOptionsImpl();
+      RunWebApp runWebApp = new RunWebApp(options);
+      ArgProcessor argProcessor = runWebApp.new ArgProcessor(options);
+      if (argProcessor.processArgs(args)) {
+        runWebApp.run();
+      }
+    } catch (Exception e) {
+      System.err.println("Unable to start Jetty server");
+      e.printStackTrace();
+    }
+  }
+
+  protected File warFile;
+
+  private final RunWebAppOptions options;
+
+  public RunWebApp(RunWebAppOptions options) {
+    this.options = options;
+  }
+
+  protected void run() {
+    PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
+    logger.setMaxDetail(TreeLogger.WARN);
+    int port = options.getPort();
+    try {
+      ServletContainer scl = new JettyLauncher().start(logger, port,  
warFile);
+      port = scl.getPort();
+    } catch (Exception e) {
+      System.err.println("Unable to start Jetty server");
+      e.printStackTrace();
+      return;
+    }
+    if (options.getStartupURLs().isEmpty()) {
+      options.addStartupURL("/");
+    }
+    for (String startupUrl : options.getStartupURLs()) {
+      startupUrl = HostedModeBase.normalizeURL(startupUrl,  
port, "localhost");
+      BrowserWidget.launchExternalBrowser(logger, startupUrl);
+    }
+  }
+}

Modified:  
releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java       
 
(original)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java       
 
Tue Mar 10 18:42:26 2009
@@ -175,9 +175,7 @@
    private static final String EXPECTED_GWT_ONLOAD_VERSION = "1.6";

    public static void launchExternalBrowser(TreeLogger logger, String  
location) {
-    // check GWT_EXTERNAL_BROWSER first, it overrides everything else
-    LowLevel.init();
-    String browserCmd = LowLevel.getEnv("GWT_EXTERNAL_BROWSER");
+    String browserCmd = System.getenv("GWT_EXTERNAL_BROWSER");
      if (browserCmd != null) {
        browserCmd += " " + location;
        try {

Modified: releases/1.6/distro-source/linux/build.xml
==============================================================================
--- releases/1.6/distro-source/linux/build.xml  (original)
+++ releases/1.6/distro-source/linux/build.xml  Tue Mar 10 18:42:26 2009
@@ -11,7 +11,7 @@
        <tarfileset file="${gwt.build.lib}/gwt-dev-${dist.platform}.jar"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-user.jar"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-servlet.jar"  
prefix="${project.distname}" />
-      <tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar"  
prefix="${project.distname}" />
+      <tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.war"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-api-checker.jar"  
prefix="${project.distname}" />

        <!-- jni libs-->

Modified: releases/1.6/distro-source/linux/src/benchmarkViewer
==============================================================================
--- releases/1.6/distro-source/linux/src/benchmarkViewer        (original)
+++ releases/1.6/distro-source/linux/src/benchmarkViewer        Tue Mar 10  
18:42:26 2009
@@ -1,3 +1,3 @@
  #!/bin/sh
  APPDIR=`dirname $0`;
-java -Dcom.google.gwt.junit.reportPath="$1"  
-cp 
"$APPDIR/gwt-user.jar:$APPDIR/gwt-dev-linux.jar:$APPDIR/gwt-benchmark-viewer.jar"
  
com.google.gwt.dev.GWTShell -port auto  
com.google.gwt.benchmarks.viewer.ReportViewer/ReportViewer.html?gwt.hybrid;
+java -Dcom.google.gwt.junit.reportPath="$1"  
-cp "$APPDIR/gwt-dev-linux.jar" com.google.gwt.dev.RunWebApp -port auto  
$APPDIR/gwt-benchmark-viewer.war;

Modified: releases/1.6/distro-source/mac/build.xml
==============================================================================
--- releases/1.6/distro-source/mac/build.xml    (original)
+++ releases/1.6/distro-source/mac/build.xml    Tue Mar 10 18:42:26 2009
@@ -11,7 +11,7 @@
        <tarfileset file="${gwt.build.lib}/gwt-dev-${dist.platform}.jar"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-user.jar"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-servlet.jar"  
prefix="${project.distname}" />
-      <tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar"  
prefix="${project.distname}" />
+      <tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.war"  
prefix="${project.distname}" />
        <tarfileset file="${gwt.build.lib}/gwt-api-checker.jar"  
prefix="${project.distname}" />

        <!-- jni libs-->

Modified: releases/1.6/distro-source/mac/src/benchmarkViewer
==============================================================================
--- releases/1.6/distro-source/mac/src/benchmarkViewer  (original)
+++ releases/1.6/distro-source/mac/src/benchmarkViewer  Tue Mar 10 18:42:26  
2009
@@ -1,3 +1,3 @@
  #!/bin/sh
  APPDIR=`dirname $0`;
-java  -Dcom.google.gwt.junit.reportPath="$1" -XstartOnFirstThread  
-cp 
"$APPDIR/gwt-user.jar:$APPDIR/gwt-dev-mac.jar:$APPDIR/gwt-benchmark-viewer.jar" 
 
com.google.gwt.dev.GWTShell -port auto  
com.google.gwt.benchmarks.viewer.ReportViewer/ReportViewer.html?gwt.hybrid;
+java  -Dcom.google.gwt.junit.reportPath="$1" -XstartOnFirstThread  
-cp "$APPDIR/gwt-dev-mac.jar" com.google.gwt.dev.RunWebApp -port auto  
$APPDIR/gwt-benchmark-viewer.war;

Modified: releases/1.6/distro-source/windows/build.xml
==============================================================================
--- releases/1.6/distro-source/windows/build.xml        (original)
+++ releases/1.6/distro-source/windows/build.xml        Tue Mar 10 18:42:26 2009
@@ -11,7 +11,7 @@
        <zipfileset file="${gwt.build.lib}/gwt-dev-${dist.platform}.jar"  
prefix="${project.distname}" />
        <zipfileset file="${gwt.build.lib}/gwt-user.jar"  
prefix="${project.distname}" />
        <zipfileset file="${gwt.build.lib}/gwt-servlet.jar"  
prefix="${project.distname}" />
-      <zipfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar"  
prefix="${project.distname}" />
+      <zipfileset file="${gwt.build.lib}/gwt-benchmark-viewer.war"  
prefix="${project.distname}" />
        <zipfileset file="${gwt.build.lib}/gwt-api-checker.jar"  
prefix="${project.distname}" />

        <!-- jni libs-->

Modified: releases/1.6/distro-source/windows/src/benchmarkViewer.cmd
==============================================================================
--- releases/1.6/distro-source/windows/src/benchmarkViewer.cmd  (original)
+++ releases/1.6/distro-source/windows/src/benchmarkViewer.cmd  Tue Mar 10  
18:42:26 2009
@@ -1 +1 @@
-...@java -Dcom.google.gwt.junit.reportPath="%1"  
-cp 
"%~dp0/gwt-user.jar;%~dp0/gwt-dev-windows.jar;%~dp0/gwt-benchmark-viewer.jar"  
com.google.gwt.dev.GWTShell -port auto  
com.google.gwt.benchmarks.viewer.ReportViewer/ReportViewer.html?gwt.hybrid;
+...@java -Dcom.google.gwt.junit.reportPath="%1"  
-cp "%~dp0/gwt-dev-windows.jar" com.google.gwt.dev.RunWebApp -port  
auto %~dp0/gwt-benchmark-viewer.war
\ No newline at end of file

Modified: releases/1.6/eclipse/tools/benchmark-viewer/.classpath
==============================================================================
--- releases/1.6/eclipse/tools/benchmark-viewer/.classpath      (original)
+++ releases/1.6/eclipse/tools/benchmark-viewer/.classpath      Tue Mar 10  
18:42:26 2009
@@ -1,9 +1,10 @@
  <?xml version="1.0" encoding="UTF-8"?>
  <classpath>
-       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="core/src"/>
+       <classpathentry kind="src" output="war" path="core/war"/>
        <classpathentry kind="con"  
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry combineaccessrules="false" kind="src" path="/gwt-user"/>
        <classpathentry kind="var"  
path="GWT_TOOLS/lib/jfreechart/jfreechart-1.0.3.jar"/>
        <classpathentry kind="var"  
path="GWT_TOOLS/lib/jfreechart/jcommon-1.0.6.jar"/>
-       <classpathentry kind="output" path="bin"/>
+       <classpathentry kind="output" path="war/WEB-INF/classes"/>
  </classpath>

Modified: releases/1.6/eclipse/tools/benchmark-viewer/.project
==============================================================================
--- releases/1.6/eclipse/tools/benchmark-viewer/.project        (original)
+++ releases/1.6/eclipse/tools/benchmark-viewer/.project        Tue Mar 10  
18:42:26 2009
@@ -22,9 +22,9 @@
        </natures>
        <linkedResources>
                <link>
-                       <name>src</name>
+                       <name>core</name>
                        <type>2</type>
-                       
<locationURI>GWT_ROOT/tools/benchmark-viewer/src</locationURI>
+                       
<locationURI>GWT_ROOT/tools/benchmark-viewer</locationURI>
                </link>
        </linkedResources>
  </projectDescription>

Modified: releases/1.6/tools/benchmark-viewer/build.xml
==============================================================================
--- releases/1.6/tools/benchmark-viewer/build.xml       (original)
+++ releases/1.6/tools/benchmark-viewer/build.xml       Tue Mar 10 18:42:26 2009
@@ -1,137 +1,91 @@
  <project name="benchmark-viewer" default="build" basedir=".">

-        <!--
-          TODO(tobyr)
+  <!--
+    TODO(tobyr)

-          Once we have more than a single tool, this build should be  
re-examined
-          to see if several of the targets should be lifted into  
common.ant.xml.
-          The simple targets, like tests*, clean, and checkstyle are good
-          candidates, while the other targets depend heavily on the actual
-          makeup of the future tools.
-        -->
+    Once we have more than a single tool, this build should be re-examined
+    to see if several of the targets should be lifted into common.ant.xml.
+    The simple targets, like tests*, clean, and checkstyle are good
+    candidates, while the other targets depend heavily on the actual
+    makeup of the future tools.
+  -->

-        <property name="gwt.root" location="../.." />
+  <property name="gwt.root" location="../.." />
    <property name="project.tail" value="tools/benchmark-viewer" />
    <import file="${gwt.root}/common.ant.xml" />

-        <property name="tools.build"  
value="${gwt.build.out}/${project.tail}" />
-        <property name="tools.module"  
value="com.google.gwt.benchmarks.viewer.ReportViewer" />
-        <property name="tools.module.path"  
value="com/google/gwt/benchmarks/viewer/public" />
-
-  <!--
-    Default hosted mode test cases
-  -->
-  <fileset id="default.hosted.tests" dir="${javac.junit.out}">
-    <include name="**/*Test.class" />
-  </fileset>
-
-  <!--
-    Default web mode test cases
-  -->
-  <fileset id="default.web.tests" dir="${javac.junit.out}">
-    <include name="**/*Test.class" />
-  </fileset>
-
-  <!-- Platform shouldn't matter here, just picking one -->
+    <!-- Platform shouldn't matter here, just picking one -->
    <property.ensure name="gwt.dev.jar"  
location="${gwt.build.lib}/gwt-dev-linux.jar" />
    <property.ensure name="gwt.user.jar"  
location="${gwt.build.lib}/gwt-user.jar" />
+  <property.ensure name="gwt.servlet.jar"  
location="${gwt.build.lib}/gwt-servlet.jar" />

-  <target name="compile" description="Compile all class files">
-    <mkdir dir="${javac.out}" />
-    <gwt.javac>
-      <classpath>
-        <pathelement  
location="${gwt.tools.lib}/tomcat/servlet-api-2.4.jar" />
-        <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
-        <pathelement  
location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
-        <pathelement  
location="${gwt.tools.lib}/jfreechart/jcommon-1.0.6.jar" />
-        <pathelement location="${gwt.dev.jar}" />
-        <pathelement location="${gwt.user.jar}" />
-      </classpath>
-    </gwt.javac>
-  </target>
+  <property name="war" location="${project.build}/war" />

-  <target name="compile.tests" description="Compiles the test code for  
this project">
-    <mkdir dir="${javac.junit.out}" />
-    <gwt.javac srcdir="test" destdir="${javac.junit.out}">
-      <classpath>
-        <pathelement location="${javac.out}" />
-        <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
-        <pathelement location="${gwt.dev.staging.jar}" />
-      </classpath>
+  <path id="project.class.path">
+    <pathelement location="war/WEB-INF/classes"/>
+    <pathelement location="${gwt.user.jar}"/>
+    <pathelement location="${gwt.dev.jar}"/>
+    <fileset dir="${war}/WEB-INF/lib" includes="**/*.jar"/>
+  </path>
+
+  <target name="wardir" description="Create the target war directory">
+    <copy todir="${war}">
+      <fileset dir="war" excludes="WEB-INF/classes/marker" />
+    </copy>
+    <mkdir dir="${war}/WEB-INF/lib" />
+    <copy todir="${war}/WEB-INF/lib" file="${gwt.servlet.jar}" />
+    <copy todir="${war}/WEB-INF/lib"  
file="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
+    <copy todir="${war}/WEB-INF/lib"  
file="${gwt.tools.lib}/jfreechart/jcommon-1.0.6.jar" />
+  </target>
+
+  <target name="javac" depends="wardir" description="Compile java source">
+    <mkdir dir="${war}/WEB-INF/classes"/>
+    <gwt.javac destdir="${war}/WEB-INF/classes">
+      <classpath refid="project.class.path"/>
      </gwt.javac>
+    <copy todir="${war}/WEB-INF/classes">
+      <fileset dir="src" excludes="**/*.java"/>
+    </copy>
    </target>

-  <target name="build" depends="compile, gwtc" description="Build and  
package this project">
-    <mkdir dir="${gwt.build.lib}" />
-                <copy todir="${tools.build}/www-new/${tools.module.path}"  
flatten="true" >
-                  <fileset dir="${tools.build}/www/${tools.module}" />
-                </copy>
-
-    <gwt.jar>
-      <fileset dir="src" excludes="**/package.html" />
-      <fileset dir="${javac.out}" />
-                        <fileset dir="${tools.build}/www-new" />
-                        <zipfileset  
src="${gwt.tools.lib}/jfreechart/itext-1.4.6.jar"/>
-                        <zipfileset  
src="${gwt.tools.lib}/jfreechart/jcommon-1.0.6.jar"/>
-                        <zipfileset  
src="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar"/>
-    </gwt.jar>
-  </target>
-
-  <target name="checkstyle" description="Static analysis of source">
-    <gwt.checkstyle>
-      <fileset dir="src"/>
-    </gwt.checkstyle>
-  </target>
-
-  <target name="gwtc" description="Compile to JavaScript">
-      <mkdir dir="${tools.build}/www" />
+  <target name="gwtc" depends="javac" description="GWT compile to  
JavaScript">
      <outofdate>
        <sourcefiles>
-        <fileset dir="src" />
-        <fileset file="${gwt.user.jar}" />
-        <fileset file="${gwt.dev.jar}" />
+        <pathelement location="src"/>
+        <path refid="project.class.path"/>
        </sourcefiles>
-      <targetfiles>
-        <fileset dir="${tools.build}/www" />
-      </targetfiles>
+      <targetfiles path="${war}/reportViewer/reportViewer.nocache.js" />
        <sequential>
-        <java dir="${tools.build}"  
classname="com.google.gwt.dev.GWTCompiler"  
classpath="src:${gwt.user.jar}:${gwt.dev.jar}" fork="yes"  
failonerror="true">
+        <java failonerror="true" fork="true"  
classname="com.google.gwt.dev.Compiler">
+          <classpath>
+            <pathelement location="src"/>
+            <path refid="project.class.path"/>
+          </classpath>
            <jvmarg value="-Xmx256M"/>
-          <arg value="-out" />
-          <arg file="${tools.build}/www" />
-          <arg value="${tools.module}" />
+          <arg value="-war"/>
+          <arg value="${war}"/>
+          <arg value="com.google.gwt.benchmarks.viewer.ReportViewer"/>
          </java>
        </sequential>
      </outofdate>
    </target>

-  <target name="remoteweb-test" description="Run a remoteweb test at the  
given host and path">
-    <echo message="Performing remote browser testing at  
rmi://${gwt.remote.browser}" />
-    <gwt.junit test.args="-out www -web -remoteweb  
rmi://${gwt.remote.browser}" test.out="${junit.out}/${gwt.remote.browser}"  
test.cases="default.web.tests" />
+  <target name="war" depends="gwtc" description="Create a war file">
+    <zip destfile="${gwt.build.lib}/gwt-benchmark-viewer.war"  
basedir="${war}"/>
    </target>

-  <target name="test" depends="compile, compile.tests" description="Run  
hosted-mode, web-mode and remoteweb tests for this project.">
-    <property.ensure name="distro.built" location="${gwt.dev.staging.jar}"  
message="GWT must be built before performing any tests.  This can be fixed  
by running ant in the ${gwt.root} directory." />
-
-    <!--
-      Run hosted and web mode tests for the platform on which this build
-      is executing
-    -->
-    <parallel threadcount="1">
-      <gwt.junit  
test.out="${junit.out}/${build.host.platform}-hosted-mode"  
test.cases="default.hosted.tests" />
-
-      <gwt.junit test.args="-out www -web"  
test.out="${junit.out}/${build.host.platform}-web-mode"  
test.cases="default.web.tests" />
+  <target name="build" depends="gwtc" description="Build this project" />

-      <!--
-        Run remote browser testing for the comma delimited list of remote  
browsers
-      -->
-      <foreach list="${gwt.remote.browsers}" delimiter="," parallel="true"  
maxThreads="1" target="remoteweb-test" param="gwt.remote.browser" />
-    </parallel>
+  <target name="clean" description="Cleans this project">
+    <delete dir="${war}" failonerror="false" />
+    <delete file="${gwt.build.lib}/gwt-benchmark-viewer.war"  
failonerror="false" />
    </target>

-  <target name="clean" description="Cleans this project's intermediate and  
output files">
-    <delete dir="${project.build}" />
-    <delete file="${project.lib}" />
+  <target name="checkstyle" description="Static analysis of source">
+    <gwt.checkstyle>
+      <fileset dir="src"/>
+    </gwt.checkstyle>
    </target>
-</project>

+  <target name="test" depends="build" />
+</project>

Modified:  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/ReportViewer.gwt.xml
==============================================================================
---  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/ReportViewer.gwt.xml
    
(original)
+++  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/ReportViewer.gwt.xml
    
Tue Mar 10 18:42:26 2009
@@ -14,7 +14,7 @@

  <!-- Deferred binding rules for browser  
selection.                          -->
   
<!--                                                                         
-->
-<module>
+<module rename-to="reportViewer">
    <inherits name="com.google.gwt.user.User"/>
    <inherits name="com.google.gwt.http.HTTP"/>

@@ -24,6 +24,4 @@

    <servlet path='/test_reports'  
class='com.google.gwt.benchmarks.viewer.server.ReportServerImpl'/>
    <servlet path='/test_images'  
class='com.google.gwt.benchmarks.viewer.server.ReportImageServer'/>
-
-  <stylesheet src="ReportViewer.css"/>
  </module>

Modified:  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportServer.java
==============================================================================
---  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportServer.java
        
(original)
+++  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportServer.java
        
Tue Mar 10 18:42:26 2009
@@ -16,6 +16,7 @@
  package com.google.gwt.benchmarks.viewer.client;

  import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

  import java.util.List;

@@ -26,6 +27,7 @@
   * @see com.google.gwt.junit.viewer.server.ReportServerImpl
   * @see ReportViewer
   */
+...@remoteservicerelativepath("test_reports")
  public interface ReportServer extends RemoteService {

    /**

Modified:  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportViewer.java
==============================================================================
---  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportViewer.java
        
(original)
+++  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/client/ReportViewer.java
        
Tue Mar 10 18:42:26 2009
@@ -23,7 +23,6 @@
  import com.google.gwt.user.client.History;
  import com.google.gwt.user.client.HistoryListener;
  import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
  import com.google.gwt.user.client.ui.Button;
  import com.google.gwt.user.client.ui.CellPanel;
  import com.google.gwt.user.client.ui.ClickListener;
@@ -36,10 +35,10 @@
  import com.google.gwt.user.client.ui.Image;
  import com.google.gwt.user.client.ui.Label;
  import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.SourcesTableEvents;
+import com.google.gwt.user.client.ui.TableListener;
  import com.google.gwt.user.client.ui.VerticalPanel;
  import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.TableListener;
-import com.google.gwt.user.client.ui.SourcesTableEvents;

  import java.util.ArrayList;
  import java.util.Collections;
@@ -88,9 +87,8 @@
      }
    }

-  private static final String baseUrl = GWT.getModuleBaseURL();
-
-  private static final String imageServer = baseUrl + "test_images/";
+  private static final String imageServer = GWT.getModuleBaseURL()
+      + "test_images/";

    HTML detailsLabel;

@@ -133,9 +131,7 @@
      init();

      // Asynchronously load the summaries
-    ServiceDefTarget target = (ServiceDefTarget)  
GWT.create(ReportServer.class);
-    target.setServiceEntryPoint(GWT.getModuleBaseURL() + "test_reports");
-    reportServer = (ReportServerAsync) target;
+    reportServer = (ReportServerAsync) GWT.create(ReportServer.class);

      reportServer.getReportSummaries(new  
AsyncCallback<List<ReportSummary>>() {
        public void onFailure(Throwable caught) {

Modified:  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/server/ReportImageServer.java
==============================================================================
---  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/server/ReportImageServer.java
   
(original)
+++  
releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/server/ReportImageServer.java
   
Tue Mar 10 18:42:26 2009
@@ -95,7 +95,8 @@
      try {
        handleRequest(request, response);
      } catch (Exception e) {
-      if (e.getClass().getName().endsWith("ClientAbortException")) {
+      if (e.getClass().getName().endsWith(".ClientAbortException")
+          || e.getClass().getName().endsWith(".EofException")) {
          // No big deal, the client browser terminated a download.
        } else {
          logException("An error occured while trying to create the chart.",  
e,

Copied: releases/1.6/tools/benchmark-viewer/war/ReportViewer.html (from  
r4963,  
/releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.html)
==============================================================================
---  
/releases/1.6/tools/benchmark-viewer/src/com/google/gwt/benchmarks/viewer/public/ReportViewer.html
       
(original)
+++ releases/1.6/tools/benchmark-viewer/war/ReportViewer.html   Tue Mar 10  
18:42:26 2009
@@ -1,9 +1,10 @@
  <html>
        <head>
+    <link type="text/css" rel="stylesheet" href="ReportViewer.css">
                <title>ReportViewer</title>
        </head>
        <body>
-               <script language="javascript"  
src="com.google.gwt.benchmarks.viewer.ReportViewer.nocache.js"></script>
+               <script language="javascript"  
src="reportViewer/reportViewer.nocache.js"></script>
                <iframe src="javascript:''" id='__gwt_historyFrame'  
style='width:0;height:0;border:0'></iframe>
        </body>
  </html>

Added: releases/1.6/tools/benchmark-viewer/war/WEB-INF/classes/marker
==============================================================================

Added: releases/1.6/tools/benchmark-viewer/war/WEB-INF/web.xml
==============================================================================
--- (empty file)
+++ releases/1.6/tools/benchmark-viewer/war/WEB-INF/web.xml     Tue Mar 10  
18:42:26 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app>
+
+  <!-- Default page to serve -->
+  <welcome-file-list>
+    <welcome-file>ReportViewer.html</welcome-file>
+  </welcome-file-list>
+
+  <!-- Servlets -->
+  <servlet>
+    <servlet-name>test_reports</servlet-name>
+     
<servlet-class>com.google.gwt.benchmarks.viewer.server.ReportServerImpl</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>test_reports</servlet-name>
+    <url-pattern>/reportViewer/test_reports</url-pattern>
+  </servlet-mapping>
+
+  <servlet>
+    <servlet-name>test_images</servlet-name>
+     
<servlet-class>com.google.gwt.benchmarks.viewer.server.ReportImageServer</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>test_images</servlet-name>
+    <url-pattern>/reportViewer/test_images/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>

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

Reply via email to