Removing unsupported deploy-to attribute from generated projects.

Review by: jlabanca (postmortem)

git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4351 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/tools/ApplicationCreator.java b/user/src/com/google/gwt/user/tools/ApplicationCreator.java
index c5fed7c..8ea80bb 100644
--- a/user/src/com/google/gwt/user/tools/ApplicationCreator.java
+++ b/user/src/com/google/gwt/user/tools/ApplicationCreator.java
@@ -21,7 +21,6 @@
 import com.google.gwt.user.tools.util.ArgHandlerIgnore;
 import com.google.gwt.user.tools.util.ArgHandlerOverwrite;
 import com.google.gwt.user.tools.util.CreatorUtilities;
-import com.google.gwt.util.tools.ArgHandlerDir;
 import com.google.gwt.util.tools.ArgHandlerExtra;
 import com.google.gwt.util.tools.ArgHandlerOutDir;
 import com.google.gwt.util.tools.ArgHandlerString;
@@ -208,7 +207,7 @@
       List<String> extraClassPaths, List<String> extraModules)
       throws IOException {
     createApplication(fullClassName, outDir, eclipse, overwrite, ignore,
-        extraClassPaths, extraModules, null, null);
+        extraClassPaths, extraModules, null);
   }
 
   /**
@@ -222,13 +221,12 @@
    *          launch configs.
    * @param extraModules A list of GWT modules to add 'inherits' tags for.
    * @param newModuleName The new module name
-   * @param deployDir The deploy directory
    * @throws IOException
    */
   static void createApplication(String fullClassName, File outDir,
       String eclipse, boolean overwrite, boolean ignore,
       List<String> extraClassPaths, List<String> extraModules,
-      String newModuleName, File deployDir) throws IOException {
+      String newModuleName) throws IOException {
 
     // Figure out the installation directory
 
@@ -291,7 +289,6 @@
       serverPackageName = "server";
     }
     File clientDir = Utility.getDirectory(basePackageDir, "client", true);
-    File publicDir = Utility.getDirectory(basePackageDir, "public", true);
     File serverDir = Utility.getDirectory(basePackageDir, "server", true);
     String startupUrl = className + ".html";
 
@@ -320,7 +317,6 @@
         ";", extraClassPaths));
     replacements.put("@newModuleName", (newModuleName != null) ? newModuleName
         : moduleName);
-    replacements.put("@deployDir", deployDir.getName());
 
     {
       // create the module xml file, skeleton html file, skeleton css file,
@@ -425,21 +421,6 @@
     }
   }
 
-  /**
-   * Try to make the given file executable. Implementation tries to exec chmod,
-   * which may fail if the platform doesn't support it. Prints a warning to
-   * stderr if the call fails.
-   * 
-   * @param file the file to make executable
-   */
-  private static void chmodExecutable(File file) {
-    try {
-      Runtime.getRuntime().exec("chmod u+x " + file.getAbsolutePath());
-    } catch (Throwable e) {
-      System.err.println(("Warning: cannot exec chmod to set permission on generated file."));
-    }
-  }
-
   private static String createExtraModuleInherits(List<String> modules) {
     if (modules == null) {
       return "";
@@ -462,7 +443,6 @@
   private File outDir;
   private boolean overwrite = false;
   private String newModuleName = null;
-  private File deployDir;
 
   protected ApplicationCreator() {
 
@@ -537,35 +517,6 @@
         newModuleName = str;
         return true;
       }
-
-    });
-
-    // handler to create the deployDir
-    registerHandler(new ArgHandlerDir() {
-
-      @Override
-      public String[] getDefaultArgs() {
-        return new String[] {"-deployDir", "deployDir"};
-      }
-
-      @Override
-      public String getPurpose() {
-        return "Specifies the deploy directory (defaults to deployDir)";
-      }
-
-      @Override
-      public String getTag() {
-        return "-deployDir";
-      }
-
-      @Override
-      public void setDir(File dir) {
-        if (dir.getName().length() == 0) {
-          throw new IllegalArgumentException("deployDir may not be empty");
-        }
-        deployDir = dir;
-      }
-
     });
 
     registerHandler(new ArgHandlerAppClass());
@@ -577,7 +528,7 @@
     try {
       createApplication(fullClassName, outDir, eclipse, overwrite, ignore,
           classPathHandler.getExtraClassPathList(),
-          moduleHandler.getExtraModuleList(), newModuleName, deployDir);
+          moduleHandler.getExtraModuleList(), newModuleName);
       return true;
     } catch (IOException e) {
       System.err.println(e.getClass().getName() + ": " + e.getMessage());
diff --git a/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc b/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
index 79536b4..51c660a 100644
--- a/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
+++ b/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
@@ -1,4 +1,4 @@
-<module rename-to='@newModuleName' deploy-to='/@deployDir'>
+<module rename-to='@newModuleName'>
 
       <!-- Inherit the core Web Toolkit stuff.                        -->
       <inherits name='com.google.gwt.user.User'/>
@@ -15,5 +15,4 @@
 
       <!-- Specify the app entry point class.                         -->
       <entry-point class='@clientPackage.@className'/>
-
 </module>