Revision: 7037 Author: [email protected] Date: Thu Nov 19 13:49:05 2009 Log: GWTShell must not link public and autogenerated artifacts into the shell generated resource directory.
A generated selection script from a previous dev run could be served instead of a compiled selection script from the "out" directory. Found by: bobv Review by: jat http://code.google.com/p/google-web-toolkit/source/detail?r=7037 Modified: /trunk/dev/core/src/com/google/gwt/dev/DevMode.java /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java /trunk/dev/core/src/com/google/gwt/dev/GWTShell.java ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/DevMode.java Wed Nov 18 13:50:42 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/DevMode.java Thu Nov 19 13:49:05 2009 @@ -380,20 +380,17 @@ @Override protected synchronized void produceOutput(TreeLogger logger, - StandardLinkerContext linkerStack, ArtifactSet artifacts, ModuleDef module) - throws UnableToCompleteException { - TreeLogger linkLogger = logger.branch(TreeLogger.DEBUG, "Linking module '" - + module.getName() + "'"); - + StandardLinkerContext linkerStack, ArtifactSet artifacts, + ModuleDef module, boolean isRelink) throws UnableToCompleteException { OutputFileSetOnDirectory outFileSet = new OutputFileSetOnDirectory( options.getWarDir(), module.getName() + "/"); - linkerStack.produceOutput(linkLogger, artifacts, false, outFileSet); + linkerStack.produceOutput(logger, artifacts, false, outFileSet); outFileSet.close(); if (options.getExtraDir() != null) { OutputFileSetOnDirectory extraFileSet = new OutputFileSetOnDirectory( options.getExtraDir(), module.getName() + "/"); - linkerStack.produceOutput(linkLogger, artifacts, true, extraFileSet); + linkerStack.produceOutput(logger, artifacts, true, extraFileSet); extraFileSet.close(); } } ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java Thu Nov 19 12:24:42 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java Thu Nov 19 13:49:05 2009 @@ -868,7 +868,7 @@ StandardLinkerContext linkerStack = new StandardLinkerContext(linkLogger, module, options); ArtifactSet artifacts = linkerStack.invokeLink(linkLogger); - produceOutput(linkLogger, linkerStack, artifacts, module); + produceOutput(linkLogger, linkerStack, artifacts, module, false); return linkerStack; } @@ -923,8 +923,8 @@ } protected abstract void produceOutput(TreeLogger logger, - StandardLinkerContext linkerStack, ArtifactSet artifacts, ModuleDef module) - throws UnableToCompleteException; + StandardLinkerContext linkerStack, ArtifactSet artifacts, + ModuleDef module, boolean isRelink) throws UnableToCompleteException; protected final void setDone() { blockUntilDone.release(); @@ -1010,6 +1010,6 @@ ArtifactSet artifacts = linkerContext.invokeRelink(linkLogger, newlyGeneratedArtifacts); - produceOutput(linkLogger, linkerContext, artifacts, module); + produceOutput(linkLogger, linkerContext, artifacts, module, true); } } ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/GWTShell.java Thu Nov 19 13:48:55 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/GWTShell.java Thu Nov 19 13:49:05 2009 @@ -210,17 +210,21 @@ } protected synchronized void produceOutput(TreeLogger logger, - StandardLinkerContext linkerStack, ArtifactSet artifacts, ModuleDef module) - throws UnableToCompleteException { - TreeLogger linkLogger = logger.branch(TreeLogger.DEBUG, "Linking module '" - + module.getName() + "'"); - - File outputDir = options.getShellPublicGenDir(module); - outputDir.mkdirs(); - OutputFileSetOnDirectory outFileSet = new OutputFileSetOnDirectory( - outputDir, ""); - linkerStack.produceOutput(linkLogger, artifacts, false, outFileSet); - outFileSet.close(); + StandardLinkerContext linkerStack, ArtifactSet artifacts, + ModuleDef module, boolean isRelink) throws UnableToCompleteException { + /* + * Legacy: in GWTShell we only copy generated artifacts into the public gen + * folder. Public files and "autogen" files have special handling (that + * needs to die). + */ + if (isRelink) { + File outputDir = options.getShellPublicGenDir(module); + outputDir.mkdirs(); + OutputFileSetOnDirectory outFileSet = new OutputFileSetOnDirectory( + outputDir, ""); + linkerStack.produceOutput(logger, artifacts, false, outFileSet); + outFileSet.close(); + } } protected boolean shouldAutoGenerateResources() { -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
