BinaryEmittedArtifact now forces subclasses to implement getLastModified.

Review by: spoon@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7818 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/BinaryEmittedArtifact.java b/dev/core/src/com/google/gwt/core/ext/linker/BinaryEmittedArtifact.java
index 1828b1f..54679fb 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/BinaryEmittedArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/BinaryEmittedArtifact.java
@@ -31,4 +31,10 @@
   protected BinaryEmittedArtifact(String partialPath) {
     super(StandardLinkerContext.class, partialPath);
   }
+  
+  /**
+   * Force subclasses to define.
+   */
+  @Override
+  public abstract long getLastModified();
 }
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/BinaryOnlyArtifactWrapper.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/BinaryOnlyArtifactWrapper.java
index 3cf6fca..b3c868b 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/BinaryOnlyArtifactWrapper.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/BinaryOnlyArtifactWrapper.java
@@ -40,4 +40,9 @@
       throws UnableToCompleteException {
     return underlyingArtifact.getContents(logger);
   }
+
+  @Override
+  public long getLastModified() {
+    return underlyingArtifact.getLastModified();
+  }
 }
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java
index 1c1885e..89678d2 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java
@@ -83,4 +83,9 @@
       throw new UnableToCompleteException();
     }
   }
+
+  @Override
+  public long getLastModified() {
+    return entry.getTime();
+  }
 }
diff --git a/dev/core/src/com/google/gwt/dev/Link.java b/dev/core/src/com/google/gwt/dev/Link.java
index cbaf113..eaa6ae4 100644
--- a/dev/core/src/com/google/gwt/dev/Link.java
+++ b/dev/core/src/com/google/gwt/dev/Link.java
@@ -154,10 +154,10 @@
         module, precompileOptions);
     ArtifactSet artifacts = doSimulatedShardingLink(logger, module,
         linkerContext, generatedArtifacts, permutations, resultFiles);
-    OutputFileSet outFileSet = new OutputFileSetOnDirectory(outDir,
-        module.getName() + "/");
-    OutputFileSet extraFileSet = new OutputFileSetOnDirectory(outDir,
-        module.getName() + "-aux/");
+    OutputFileSet outFileSet = chooseOutputFileSet(outDir, module.getName()
+        + "/");
+    OutputFileSet extraFileSet = chooseOutputFileSet(outDir, module.getName()
+        + "-aux/");
     doProduceOutput(logger, artifacts, linkerContext, outFileSet, extraFileSet);
   }
 
@@ -216,7 +216,9 @@
         } else {
           jarEntryPath = "target/" + art.getPartialPath();
         }
-        jar.putNextEntry(new ZipEntry(jarEntryPath));
+        ZipEntry ze = new ZipEntry(jarEntryPath);
+        ze.setTime(art.getLastModified());
+        jar.putNextEntry(ze);
         art.writeTo(logger, jar);
         jar.closeEntry();
       }