Author: [email protected]
Date: Tue Jan 13 11:58:49 2009
New Revision: 4442

Modified:
    releases/1.6/user/src/com/google/gwt/user/tools/.classpathsrc
    releases/1.6/user/src/com/google/gwt/user/tools/ApplicationCreator.java
    releases/1.6/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc

Log:
For public GWT builds, application creator now generates a DTD reference in  
the GWT module.

Review by: bobv
Issue: 2190

Modified: releases/1.6/user/src/com/google/gwt/user/tools/.classpathsrc
==============================================================================
--- releases/1.6/user/src/com/google/gwt/user/tools/.classpathsrc       
(original)
+++ releases/1.6/user/src/com/google/gwt/user/tools/.classpathsrc       Tue Jan 
 
13 11:58:49 2009
@@ -4,6 +4,5 @@
     <classpathentry kind="lib" path="@gwtUserPath"/>
     <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"/>
-...@eclipseclasspathentries
+   <classpathentry kind="output"  
path="war/WEB-INF/classes"/>@eclipseClassPathEntries
  </classpath>

Modified:  
releases/1.6/user/src/com/google/gwt/user/tools/ApplicationCreator.java
==============================================================================
--- releases/1.6/user/src/com/google/gwt/user/tools/ApplicationCreator.java     
 
(original)
+++ releases/1.6/user/src/com/google/gwt/user/tools/ApplicationCreator.java     
 
Tue Jan 13 11:58:49 2009
@@ -15,6 +15,7 @@
   */
  package com.google.gwt.user.tools;

+import com.google.gwt.dev.About;
  import com.google.gwt.dev.Compiler;
  import com.google.gwt.dev.HostedMode;
  import com.google.gwt.dev.cfg.ModuleDefLoader;
@@ -237,40 +238,31 @@
      String gwtDevPath = installPath + '/' + Utility.getDevJarName();
      String gwtServletPath = installPath + '/' + "gwt-servlet.jar";

+    // Public builds generate a DTD reference.
+    String gwtModuleDtd = "";
+    if (!About.GWT_VERSION_NUM.endsWith(".999")
+        && !About.GWT_VERSION_NUM.startsWith("0.0")) {
+      gwtModuleDtd = "\n<!DOCTYPE module PUBLIC \"-//Google Inc.//DTD  
Google Web Toolkit "
+          + About.GWT_VERSION_NUM
+          + "//EN\" \"http://google-web-toolkit.googlecode.com/svn/tags/";
+          + About.GWT_VERSION_NUM  
+ "/distro-source/core/src/gwt-module.dtd\">";
+    }
+
      // Validate the arguments for extra class path entries and modules.
      if (!CreatorUtilities.validatePathsAndModules(gwtUserPath,  
extraClassPaths,
          extraModules)) {
        return;
      }
      // Figure out what platform we're on
-    //
-    boolean isWindows = gwtDevPath.substring(gwtDevPath.lastIndexOf('/') +  
1).indexOf(
-        "windows") >= 0;
      boolean isMacOsX = gwtDevPath.substring(gwtDevPath.lastIndexOf('/') +  
1).indexOf(
          "mac") >= 0;

-    // If the path from here to the install directory is relative, we need  
to
-    // set specific "base" directory tags; this is for sample generation  
during
-    // the build.
-    String basePathEnv;
-    if (!new File(installPath).isAbsolute()) {
-      if (isWindows) {
-        basePathEnv = "%~dp0\\";
-      } else {
-        basePathEnv = "$APPDIR/";
-      }
-    } else {
-      basePathEnv = "";
-    }
-
      // Check out the class and package names.
-    //
      int pos = fullClassName.lastIndexOf('.');
      String clientPackageName = fullClassName.substring(0, pos);
      String className = fullClassName.substring(pos + 1);

      // Compute module name and directories
-    //
      pos = clientPackageName.lastIndexOf('.');
      File basePackageDir;
      String moduleName;
@@ -300,8 +292,10 @@
      replacements.put("@moduleName", moduleName);
      replacements.put("@clientPackage", clientPackageName);
      replacements.put("@serverPackage", serverPackageName);
-    replacements.put("@gwtUserPath", basePathEnv + gwtUserPath);
-    replacements.put("@gwtDevPath", basePathEnv + gwtDevPath);
+    replacements.put("@gwtUserPath", gwtUserPath);
+    replacements.put("@gwtDevPath", gwtDevPath);
+    replacements.put("@gwtVersion", About.GWT_VERSION_NUM);
+    replacements.put("@gwtModuleDtd", gwtModuleDtd);
      replacements.put("@shellClass", HostedMode.class.getName());
      replacements.put("@compileClass", Compiler.class.getName());
      replacements.put("@startupUrl", startupUrl);
@@ -364,7 +358,7 @@
      if (eclipse != null) {
        replacements.put("@projectName", eclipse);
        // Build the list of extra paths
-      replacements.put("@gwtServletPath", basePathEnv + gwtServletPath);
+      replacements.put("@gwtServletPath", gwtServletPath);
        StringBuilder buf = new StringBuilder();
        if (extraClassPaths != null) {
          for (String path : extraClassPaths) {
@@ -392,11 +386,11 @@
              throw new RuntimeException("Don't know how to handle path: " +  
path
                  + ". It doesn't appear to be a directory or a .jar file");
            }
-          classpathEntries.append("   <classpathentry kind=\"");
+          classpathEntries.append("\n   <classpathentry kind=\"");
            classpathEntries.append(kindString);
            classpathEntries.append("\" path=\"");
            classpathEntries.append(path);
-          classpathEntries.append("\"/>\n");
+          classpathEntries.append("\"/>");
          }
        }
        replacements.put("@eclipseClassPathEntries",  
classpathEntries.toString());
@@ -429,9 +423,9 @@
      // Create an <inherits> tag in the gwt.xml file for each extra module
      StringBuilder buf = new StringBuilder();
      for (String module : modules) {
-      buf.append("      <inherits name=\"");
+      buf.append("\n  <inherits name=\"");
        buf.append(module);
-      buf.append("\" />\n");
+      buf.append("\" />");
      }
      return buf.toString();
    }

Modified: releases/1.6/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
==============================================================================
--- releases/1.6/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc    
(original)
+++ releases/1.6/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc   Tue  
Jan 13 11:58:49 2009
@@ -1,18 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>@gwtModuleDtd
  <module rename-to='@newModuleName'>
+  <!-- Inherit the core Web Toolkit stuff.                        -->
+  <inherits name='com.google.gwt.user.User'/>

-      <!-- Inherit the core Web Toolkit stuff.                        -->
-      <inherits name='com.google.gwt.user.User'/>
-       
-      <!-- Inherit the default GWT style sheet.  You can change       -->
-      <!-- the theme of your GWT application by uncommenting          -->
-      <!-- any one of the following lines.                            -->
-      <inherits name='com.google.gwt.user.theme.standard.Standard'/>
-      <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
-      <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+  <!-- Inherit the default GWT style sheet.  You can change       -->
+  <!-- the theme of your GWT application by uncommenting          -->
+  <!-- any one of the following lines.                            -->
+  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
+  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

-      <!-- Other module inherits                                      -->
-...@extramoduleinherits
+  <!-- Other module inherits                                       
-->@extraModuleInherits

-      <!-- Specify the app entry point class.                         -->
-      <entry-point class='@clientpacka...@classname'/>
+  <!-- Specify the app entry point class.                         -->
+  <entry-point class='@clientpacka...@classname'/>
  </module>

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

Reply via email to