JsOutputOption output) throws IOException, UnableToCompleteException, InterruptedException {
// Make sure we're using a MemoryUnitCache.
System.setProperty(UnitCacheSingleton.GWT_PERSISTENTUNITCACHE, "false");
// Wait 1 second so that any new file modification times are actually different.
Thread.sleep(1001);
PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
logger.setMaxDetail(TreeLogger.ERROR);
// We might be reusing the same application dir but we want to make sure that the output dir is
// clean to avoid confusion when returning the output JS.
File outputDir = new File(applicationDir.getPath() + File.separator + moduleName);
if (outputDir.exists()) {
Util.recursiveDelete(outputDir, true);