Revision: 8885
Author: [email protected]
Date: Tue Sep 28 06:03:15 2010
Log: Remove the output from the link step before attempting to
write. Fixes a problem when the output has been set to
read only permissions.
Review at http://gwt-code-reviews.appspot.com/928801
http://code.google.com/p/google-web-toolkit/source/detail?r=8885
Modified:
/trunk/dev/core/src/com/google/gwt/dev/Link.java
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/Link.java Wed Aug 25 08:20:08
2010
+++ /trunk/dev/core/src/com/google/gwt/dev/Link.java Tue Sep 28 06:03:15
2010
@@ -16,6 +16,7 @@
package com.google.gwt.dev;
import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.Artifact;
import com.google.gwt.core.ext.linker.ArtifactSet;
@@ -189,6 +190,13 @@
PermutationResult permResult, File jarFile,
PrecompileOptions precompileOptions) throws
UnableToCompleteException {
try {
+ if (jarFile.exists()) {
+ boolean success = jarFile.delete();
+ if (!success) {
+ logger.log(Type.ERROR, "Linker output file " + jarFile.getName()
+ + " already exists and can't be deleted.");
+ }
+ }
JarOutputStream jar = new JarOutputStream(new
FileOutputStream(jarFile));
StandardLinkerContext linkerContext = new
StandardLinkerContext(logger,
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors