Hi Scott, I'd like to you do a code review. To apply this patch, navigate to the the root of the GWT 1.6 releases branch, and perform the following steps:
svn update -r4449 patch -p0 < updatedWebAppCreatorWithProjectNameParam-r4449.patch Description: In the migration from ApplicationCreator to WebAppCreator, the parameter to specify the Eclipse project name to the createApplication method was removed. This is a useful argument, as there are other clients of this API that wish to specify the Eclipse project name directly, instead of having it inferred from the module name. Affected Files: M user/src/com/google/gwt/user/tools/.projectsrc M user/src/com/google/gwt/user/tools/App.launchsrc M user/src/com/google/gwt/user/tools/WebAppCreator.java Thanks, Rajeev --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
Index: user/src/com/google/gwt/user/tools/.projectsrc =================================================================== --- user/src/com/google/gwt/user/tools/.projectsrc (revision 4449) +++ user/src/com/google/gwt/user/tools/.projectsrc (working copy) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <projectDescription> - <name>@moduleShortName</name> - <comment>@moduleShortName project</comment> + <name>@projectName</name> + <comment>@projectName project</comment> <projects/> <buildSpec> <buildCommand> Index: user/src/com/google/gwt/user/tools/App.launchsrc =================================================================== --- user/src/com/google/gwt/user/tools/App.launchsrc (revision 4449) +++ user/src/com/google/gwt/user/tools/App.launchsrc (working copy) @@ -3,13 +3,13 @@ <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="@shellClass"/> <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> -<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="@moduleShortName" path="1" type="4"/> "/> -<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/@moduleShortName/src" path="3" type="2"/> "/> -<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento project="@moduleShortName"/> </runtimeClasspathEntry> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="@projectName" path="1" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/@projectName/src" path="3" type="2"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento project="@projectName"/> </runtimeClasspathEntry> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry externalArchive="@gwtDevPath" path="3" type="2"/> "/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-xmx2...@vmargs"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-startupUrl @startupUrl @moduleName"/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@moduleShortName"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName"/> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> </launchConfiguration> Index: user/src/com/google/gwt/user/tools/WebAppCreator.java =================================================================== --- user/src/com/google/gwt/user/tools/WebAppCreator.java (revision 4449) +++ user/src/com/google/gwt/user/tools/WebAppCreator.java (working copy) @@ -159,7 +159,22 @@ */ static void createApplication(String moduleName, File outDir, boolean overwrite, boolean ignore) throws IOException { + createApplication(moduleName, outDir, null, overwrite, ignore); + } + /** + * @param moduleName name of the fully-qualified GWT module to create as an + * Application. + * @param outDir Where to put the output files + * @param projectName The name of the generated Eclipse project for this + * application, or null to generate one automatically + * @param overwrite Overwrite an existing files if they exist. + * @param ignore Ignore existing files if they exist. + * @throws IOException + */ + static void createApplication(String moduleName, File outDir, + String projectName, boolean overwrite, boolean ignore) throws IOException { + // Figure out the installation directory String installPath = Utility.getInstallPath(); String gwtUserPath = installPath + '/' + "gwt-user.jar"; @@ -197,6 +212,8 @@ // Create a map of replacements Map<String, String> replacements = new HashMap<String, String>(); replacements.put("@moduleShortName", moduleShortName); + replacements.put("@projectName", (projectName == null ? moduleShortName + : projectName)); replacements.put("@moduleName", moduleName); replacements.put("@clientPackage", modulePackageName + ".client"); replacements.put("@serverPackage", modulePackageName + ".server");