Author: [email protected]
Date: Wed Jul  1 06:11:31 2009
New Revision: 5652

Added:
     
branches/crawlability/user/src/com/google/gwt/user/tools/.classpathcrawlablesrc
     
branches/crawlability/user/src/com/google/gwt/user/tools/.projectcrawlablesrc
     
branches/crawlability/user/src/com/google/gwt/user/tools/webcrawlable.xmlsrc
Modified:
    branches/crawlability/common.ant.xml
    branches/crawlability/eclipse/dev/mac/.project
    branches/crawlability/eclipse/samples/Hello/Hello-gwtc.launch
    branches/crawlability/eclipse/samples/Hello/Hello.launch
    branches/crawlability/eclipse/samples/Showcase/.classpath
    branches/crawlability/eclipse/samples/Showcase/Showcase.launch
    branches/crawlability/eclipse/user/.classpath
     
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml
     
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
    branches/crawlability/servlet/build.xml
    branches/crawlability/user/src/com/google/gwt/user/client/ui/ListBox.java
     
branches/crawlability/user/src/com/google/gwt/user/tools/WebAppCreator.java

Log:
Modifies WebAppCreator to allow creating crawl-enabled projects.
NOTE: In WebAppCreator in this revision, crawlable defaults to true, so I  
can use this in the eclipse plugin.  Once the eclipse plugin is modified,  
this should default to false.



Modified: branches/crawlability/common.ant.xml
==============================================================================
--- branches/crawlability/common.ant.xml        (original)
+++ branches/crawlability/common.ant.xml        Wed Jul  1 06:11:31 2009
@@ -120,6 +120,11 @@
      </classpath>
    </taskdef>

+  <!-- jarjar is used to re-package HtmlUnit -->
+  <taskdef name="jarjar"
+       classname="com.tonicsystems.jarjar.JarJarTask"  
classpath="${gwt.tools.lib}/tonicsystems/jarjar-1.0rc8.jar"/>
+
+
    <!-- Global Custom Tasks -->
    <presetdef name="gwt.ant">
      <ant inheritall="false" target="${target}">

Modified: branches/crawlability/eclipse/dev/mac/.project
==============================================================================
--- branches/crawlability/eclipse/dev/mac/.project      (original)
+++ branches/crawlability/eclipse/dev/mac/.project      Wed Jul  1 06:11:31 2009
@@ -24,12 +24,12 @@
                <link>
                        <name>core</name>
                        <type>2</type>
-                       <location>GWT_ROOT/dev/core</location>
+                       <locationURI>GWT_ROOT/dev/core</locationURI>
                </link>
                <link>
                        <name>mac</name>
                        <type>2</type>
-                       <location>GWT_ROOT/dev/mac</location>
+                       <locationURI>GWT_ROOT/dev/mac</locationURI>
                </link>
        </linkedResources>
  </projectDescription>

Modified: branches/crawlability/eclipse/samples/Hello/Hello-gwtc.launch
==============================================================================
--- branches/crawlability/eclipse/samples/Hello/Hello-gwtc.launch       
(original)
+++ branches/crawlability/eclipse/samples/Hello/Hello-gwtc.launch       Wed Jul 
  
1 06:11:31 2009
@@ -1,13 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration  
type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/Hello"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
  <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables"  
value="true"/>
  <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot;  
javaProject=&quot;Hello&quot; path=&quot;1&quot;  
type=&quot;4&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
internalArchive=&quot;/Hello/core/src&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-user/core/src&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-user/core/super&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-dev-windows/core/super&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento
  
exportedEntriesOnly=&quot;false&quot;  
project=&quot;Hello&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot;  
javaProject=&quot;Hello&quot; path=&quot;1&quot;  
type=&quot;4&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
internalArchive=&quot;/Hello/core/src&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-user/core/src&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-user/core/super&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
internalArchive=&quot;/gwt-dev-mac/core/super&quot; path=&quot;3&quot;  
type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry  
id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento
  
exportedEntriesOnly=&quot;false&quot;  
project=&quot;Hello&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
  </listAttribute>
  <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH"  
value="false"/>
  <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"  
value="com.google.gwt.dev.Compiler"/>

Modified: branches/crawlability/eclipse/samples/Hello/Hello.launch
==============================================================================
--- branches/crawlability/eclipse/samples/Hello/Hello.launch    (original)
+++ branches/crawlability/eclipse/samples/Hello/Hello.launch    Wed Jul  1  
06:11:31 2009
@@ -1,5 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration  
type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/Hello"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
  <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables"  
value="true"/>
  <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
  <listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot;  
javaProject=&quot;Hello&quot; path=&quot;1&quot;  
type=&quot;4&quot;/&gt;&#10;"/>

Modified: branches/crawlability/eclipse/samples/Showcase/.classpath
==============================================================================
--- branches/crawlability/eclipse/samples/Showcase/.classpath   (original)
+++ branches/crawlability/eclipse/samples/Showcase/.classpath   Wed Jul  1  
06:11:31 2009
@@ -4,6 +4,6 @@
        <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 combineaccessrules="false" kind="src"  
path="/gwt-dev-windows"/>
+       <classpathentry combineaccessrules="false" kind="src"  
path="/gwt-dev-mac"/>
        <classpathentry kind="output" path="war/WEB-INF/classes"/>
  </classpath>

Modified: branches/crawlability/eclipse/samples/Showcase/Showcase.launch
==============================================================================
--- branches/crawlability/eclipse/samples/Showcase/Showcase.launch       
(original)
+++ branches/crawlability/eclipse/samples/Showcase/Showcase.launch      Wed Jul 
  
1 06:11:31 2009
@@ -1,5 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration  
type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry  
value="/gwt-dev-mac/core/src/com/google/gwt/dev/HostedMode.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
  <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables"  
value="true"/>
  <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
  <listEntry value="&lt;?xml version=&quot;1.0&quot;  
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry  
containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot;  
javaProject=&quot;Showcase&quot; path=&quot;1&quot;  
type=&quot;4&quot;/&gt;&#10;"/>

Modified: branches/crawlability/eclipse/user/.classpath
==============================================================================
--- branches/crawlability/eclipse/user/.classpath       (original)
+++ branches/crawlability/eclipse/user/.classpath       Wed Jul  1 06:11:31 2009
@@ -10,6 +10,6 @@
        <classpathentry kind="var"  
path="GWT_TOOLS/lib/selenium/selenium-java-client-driver.jar"/>
        <classpathentry kind="var" path="GWT_TOOLS/lib/w3c/sac/sac-1.3.jar"/>
        <classpathentry kind="var" 
path="GWT_TOOLS/lib/w3c/flute/flute-1.3.jar"/>
-       <classpathentry combineaccessrules="false" kind="src"  
path="/gwt-dev-windows"/>
+       <classpathentry combineaccessrules="false" kind="src"  
path="/gwt-dev-mac"/>
        <classpathentry kind="output" path="bin"/>
  </classpath>

Modified:  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml
==============================================================================
---  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml
       
(original)
+++  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/Showcase.gwt.xml
       
Wed Jul  1 06:11:31 2009
@@ -21,8 +21,11 @@
    <entry-point class='com.google.gwt.sample.showcase.client.Showcase'/>

    <!-- Internationalization support. -->
-  <extend-property name="locale" values="en"/>
+<!--    <extend-property name="locale" values="en"/>
    <extend-property name="locale" values="ar"/>
    <extend-property name="locale" values="fr"/>
-  <extend-property name="locale" values="zh"/>
+  <extend-property name="locale" values="zh"/>    -->
+
+  <set-property name="user.agent" value="gecko1_8"/>
+
  </module>

Modified:  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
==============================================================================
---  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
   
(original)
+++  
branches/crawlability/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
   
Wed Jul  1 06:11:31 2009
@@ -230,7 +230,7 @@
      app.addSelectionHandler(new SelectionHandler<TreeItem>() {
        public void onSelection(SelectionEvent<TreeItem> event) {
          TreeItem item = event.getSelectedItem();
-        String historyToken =  
((Hyperlink)item.getWidget()).getTargetHistoryToken();
+        String historyToken = ((Hyperlink)  
item.getWidget()).getTargetHistoryToken();
          ContentWidget content = itemWidgets.get(item);
          if (content != null && !content.equals(app.getContent())) {
            History.newItem(historyToken);
@@ -444,7 +444,9 @@
      for (String localeName : localeNames) {
        if (!localeName.equals("default")) {
          String nativeName =  
LocaleInfo.getLocaleNativeDisplayName(localeName);
-        localeBox.addItem(nativeName, localeName);
+        // String hl = "<a href=?locale=" + localeName + ">" + nativeName  
+ "</a>";
+        // localeBox.addItem(hl, localeName, true);
+        localeBox.addItem(nativeName, localeName);
          if (localeName.equals(currentLocale)) {
            localeBox.setSelectedIndex(localeBox.getItemCount() - 1);
          }
@@ -457,6 +459,9 @@
              "");
        }
      });
+
+
+
      HorizontalPanel localeWrapper = new HorizontalPanel();
      localeWrapper.add(images.locale().createImage());
      localeWrapper.add(localeBox);

Modified: branches/crawlability/servlet/build.xml
==============================================================================
--- branches/crawlability/servlet/build.xml     (original)
+++ branches/crawlability/servlet/build.xml     Wed Jul  1 06:11:31 2009
@@ -9,6 +9,8 @@

    <target name="build" description="Packages this project into a jar">
      <mkdir dir="${gwt.build.lib}" />
+
+    <!-- build gwt-servlet.jar -->
      <gwt.jar>
        <fileset dir="${gwt.user.bin}">
          <exclude name="**/rebind/**" />
@@ -19,11 +21,47 @@
          <exclude name="com/google/gwt/junit/remote/**" />
          <exclude name="com/google/gwt/junit/server/**" />
          <exclude name="com/google/gwt/benchmarks/*" />
-      </fileset>
+      </fileset>
+<!--      <fileset dir="${gwt.build.lib}/crawldeps"  
includes="**/*.class"/> -->
+    </gwt.jar>
+
+
+    <!-- build gwt-crawl.jar -->
+    <mkdir dir="${gwt.build.lib}/crawldeps" />
+    <!-- unjar each jar, rejar into one jar -->
+    <unzip dest="${gwt.build.lib}/crawldeps">
+      <patternset>
+        <include name="**/*.class"/>
+       <exclude name="META-INF/**"/>
+      </patternset>
+      <zipfileset dir="${gwt.tools}/crawl" includes="*.jar"/>
+    </unzip>
+
+    <!-- apply jarjar replacement rules where necessary, rejar -->
+<!--    <jarjar destfile="${gwt.build.lib}/gwt-crawl.jar">
+      <patternset>
+       <exclude name="META-INF/**"/>
+      </patternset>
+      <fileset dir="${gwt.build.lib}/crawldeps"/>
+      <rule pattern="com.**" result="com.google.gwt.cra...@1.@2" />
+      <rule pattern="net.**" result="com.google.gwt.cra...@1.@2" />
+      <rule pattern="org.**" result="com.google.gwt.cra...@1.@2" />
+      <rule pattern="java_cup.**" result="com.google.gwt.cra...@1.@2" />
+    </jarjar> -->
+
+   <gwt.jar destfile="${gwt.build.lib}/gwt-crawl.jar">
+      <patternset>
+       <exclude name="META-INF/**"/>
+      </patternset>
+      <fileset dir="${gwt.build.lib}/crawldeps"/>
      </gwt.jar>
    </target>

    <target name="clean" description="Cleans this project's intermediate and  
output files">
      <delete file="${project.lib}" />
    </target>
+
  </project>
+
+
+

Modified:  
branches/crawlability/user/src/com/google/gwt/user/client/ui/ListBox.java
==============================================================================
---  
branches/crawlability/user/src/com/google/gwt/user/client/ui/ListBox.java       
 
(original)
+++  
branches/crawlability/user/src/com/google/gwt/user/client/ui/ListBox.java       
 
Wed Jul  1 06:11:31 2009
@@ -137,6 +137,17 @@
    }

    /**
+   * Adds an item to the list box, specifying an initial value for the  
item.
+   *
+   * @param item the text of the item to be added
+   * @param value the item's value, to be submitted if it is part of a
+   *          {...@link FormPanel}; cannot be <code>null</code>
+   */
+  public void addItem(String html, String value, boolean asHtml) {
+    insertItem(html, value, INSERT_AT_END, true);
+  }
+
+  /**
     * Removes all items from the list box.
     */
    public void clear() {
@@ -229,6 +240,30 @@
      SelectElement select = getSelectElement();
      OptionElement option = Document.get().createOptionElement();
      option.setText(item);
+    option.setValue(value);
+
+    if ((index == -1) || (index == select.getLength())) {
+      select.add(option, null);
+    } else {
+      OptionElement before = select.getOptions().getItem(index);
+      select.add(option, before);
+    }
+  }
+
+  /**
+   * Inserts an item into the list box, specifying an initial value for the
+   * item. If the index is less than zero, or greater than or equal to the
+   * length of the list, then the item will be appended to the end of the  
list.
+   *
+   * @param item the text of the item to be inserted
+   * @param value the item's value, to be submitted if it is part of a
+   *          {...@link FormPanel}.
+   * @param index the index at which to insert it
+   */
+  public void insertItem(String html, String value, int index, boolean  
asHtml) {
+    SelectElement select = getSelectElement();
+    OptionElement option = Document.get().createOptionElement();
+    option.setInnerHTML(html);
      option.setValue(value);

      if ((index == -1) || (index == select.getLength())) {

Added:  
branches/crawlability/user/src/com/google/gwt/user/tools/.classpathcrawlablesrc
==============================================================================
--- (empty file)
+++  
branches/crawlability/user/src/com/google/gwt/user/tools/.classpathcrawlablesrc 
 
Wed Jul  1 06:11:31 2009
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<classpath>
+   <classpathentry kind="src" path="src"/>
+   <classpathentry kind="lib" path="@gwtUserPath"/>
+   <classpathentry kind="lib" path="@gwtDevPath"/>
+   <classpathentry kind="lib" path="war/WEB-INF/lib/gwt-crawl.jar"/>
+   <classpathentry kind="con"  
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+   <classpathentry kind="con"  
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+   <classpathentry kind="output" path="war/WEB-INF/classes"/>
+</classpath>
\ No newline at end of file

Added:  
branches/crawlability/user/src/com/google/gwt/user/tools/.projectcrawlablesrc
==============================================================================
--- (empty file)
+++  
branches/crawlability/user/src/com/google/gwt/user/tools/.projectcrawlablesrc   
 
Wed Jul  1 06:11:31 2009
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<projectDescription>
+   <name>@moduleShortName</name>
+   <comment>@moduleShortName project</comment>
+   <projects/>
+   <buildSpec>
+       <buildCommand>
+           <name>org.eclipse.jdt.core.javabuilder</name>
+           <arguments/>
+       </buildCommand>
+   </buildSpec>
+   <natures>
+       <nature>org.eclipse.jdt.core.javanature</nature>
+   </natures>
+</projectDescription>

Modified:  
branches/crawlability/user/src/com/google/gwt/user/tools/WebAppCreator.java
==============================================================================
---  
branches/crawlability/user/src/com/google/gwt/user/tools/WebAppCreator.java     
 
(original)
+++  
branches/crawlability/user/src/com/google/gwt/user/tools/WebAppCreator.java     
 
Wed Jul  1 06:11:31 2009
@@ -60,6 +60,7 @@
        registerHandler(new ArgHandlerOutDirExtension());
        registerHandler(new ArgHandlerNoEclipse());
        registerHandler(new ArgHandlerOnlyEclipse());
+      registerHandler(new ArgHandlerCrawlable());
      }

      @Override
@@ -138,6 +139,29 @@
      }
    }

+  private final class ArgHandlerCrawlable extends ArgHandlerFlag {
+    @Override
+    public String getPurpose() {
+      return "Make the application crawlable";
+    }
+
+    @Override
+    public String getTag() {
+      return "-crawlable";
+    }
+
+    @Override
+    public boolean isUndocumented() {
+      return false;
+    }
+
+    @Override
+    public boolean setFlag() {
+      crawlable = true;
+      return true;
+    }
+  }
+
    private final class ArgHandlerOnlyEclipse extends ArgHandlerFlag {
      @Override
      public String getPurpose() {
@@ -160,7 +184,7 @@
        return true;
      }
    }
-
+
    private final class ArgHandlerOverwriteExtension extends  
ArgHandlerOverwrite {
      @Override
      public boolean setFlag() {
@@ -200,6 +224,7 @@
    private String moduleName;
    private boolean noEclipse;
    private boolean onlyEclipse;
+  private boolean crawlable = true;
    private File outDir;
    private boolean overwrite = false;

@@ -216,7 +241,8 @@
      String gwtDevPath = installPath + '/' + Utility.getDevJarName();
      String gwtServletPath = installPath + '/' + "gwt-servlet.jar";
      String gwtOophmPath = installPath + '/' + "gwt-dev-oophm.jar";
-
+    String gwtCrawlPath = installPath + '/' + "gwt-crawl.jar";
+
      // Public builds generate a DTD reference.
      String gwtModuleDtd = "";
      int gwtVersion[] = About.getGwtVersionArray();
@@ -249,8 +275,8 @@

      // Create a map of replacements
      Map<String, String> replacements = new HashMap<String, String>();
+    replacements.put("@moduleDir", moduleShortName);
      replacements.put("@moduleShortName", moduleShortName);
-    replacements.put("@moduleName", moduleName);
      replacements.put("@clientPackage", modulePackageName + ".client");
      replacements.put("@serverPackage", modulePackageName + ".server");
      replacements.put("@gwtSdk", installPath);
@@ -289,13 +315,13 @@

      List<FileCreator> files = new ArrayList<FileCreator>();
      List<FileCreator> libs = new ArrayList<FileCreator>();
+    List<FileCreator> classes = new ArrayList<FileCreator>();
      if (!onlyEclipse) {
        files.add(new FileCreator(moduleDir, moduleShortName + ".gwt.xml",
            "Module.gwt.xml"));
        files.add(new FileCreator(warDir, moduleShortName + ".html",
            "AppHtml.html"));
        files.add(new FileCreator(warDir, moduleShortName  
+ ".css", "AppCss.css"));
-      files.add(new FileCreator(webInfDir, "web.xml", "web.xml"));
        files.add(new FileCreator(clientDir, moduleShortName + ".java",
            "AppClassTemplate.java"));
        files.add(new FileCreator(clientDir, "GreetingService" + ".java",
@@ -307,15 +333,29 @@
        files.add(new FileCreator(outDir, "build.xml", "project.ant.xml"));
        files.add(new FileCreator(outDir, "README.txt", "README.txt"));
      }
+
+    if (crawlable) {
+      files.add(new  
FileCreator(serverDir, "CrawlServlet.java", "CrawlServlet.java"));
+      files.add(new FileCreator(webInfDir, "web.xml", "webcrawlable.xml"));
+      libs.add(new FileCreator(libDir, "gwt-crawl.jar", gwtCrawlPath));
+      if (!noEclipse) {
+        files.add(new  
FileCreator(outDir, ".classpath", ".classpathcrawlable"));
+      }
+    } else {
+      files.add(new FileCreator(webInfDir, "web.xml", "web.xml"));
+    }
+
      if (!noEclipse) {
        assert new File(gwtDevPath).isAbsolute();
        libs.add(new FileCreator(libDir, "gwt-servlet.jar", gwtServletPath));
-      files.add(new FileCreator(outDir, ".project", ".project"));
-      files.add(new FileCreator(outDir, ".classpath", ".classpath"));
+      files.add(new FileCreator(outDir, ".project", ".project"));
        files.add(new FileCreator(outDir, moduleShortName + ".launch",
            "App.launch"));
+      if (!crawlable) {
+        files.add(new FileCreator(outDir, ".classpath", ".classpath"));
+      }
      }
-
+
      // copy source files, replacing the content as needed
      for (FileCreator fileCreator : files) {
        URL url = WebAppCreator.class.getResource(fileCreator.sourceName  
+ "src");
@@ -335,6 +375,7 @@
        FileInputStream is = new FileInputStream(fileCreator.sourceName);
        File file = Utility.createNormalFile(fileCreator.destDir,
            fileCreator.destName, overwrite, ignore);
+
        if (file != null) {
          FileOutputStream os = new FileOutputStream(file);
          Util.copy(is, os);

Added:  
branches/crawlability/user/src/com/google/gwt/user/tools/webcrawlable.xmlsrc
==============================================================================
--- (empty file)
+++  
branches/crawlability/user/src/com/google/gwt/user/tools/webcrawlable.xmlsrc    
 
Wed Jul  1 06:11:31 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd";>
+
+<web-app>
+
+  <!-- Servlets -->
+  <servlet>
+    <servlet-name>greetServlet</servlet-name>
+    <servlet-class>@serverPackage.GreetingServiceImpl</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>greetServlet</servlet-name>
+    <url-pattern>/@renameTo/greet</url-pattern>
+  </servlet-mapping>
+
+  <!-- Default page to serve -->
+  <welcome-file-list>
+    <welcome-file>@startupUrl</welcome-file>
+  </welcome-file-list>
+
+  <!-- Servlet filter for crawlability -->
+    <filter>
+        <filter-name>crawlServlet</filter-name>
+        <filter-class>@serverPackage.CrawlServlet</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>crawlServlet</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+</web-app>

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

Reply via email to