use copyDir instead of moveDirWithContent because tmp dir may be on other disk

This commit is contained in:
Eugene Kudelevsky
2012-05-25 18:44:57 +04:00
parent 9e7a90a8de
commit 3c440e3dc4
2 changed files with 6 additions and 11 deletions
@@ -606,12 +606,9 @@ public class AndroidSourceGeneratingBuilder extends ModuleLevelBuilder {
success = false;
continue;
}
if (!FileUtil.moveDirWithContent(tmpOutputDir, aptOutputDirectory)) {
context.processMessage(new CompilerMessage(ANDROID_APT_COMPILER, BuildMessage.Kind.ERROR, AndroidJpsBundle
.message("android.jps.errors.cannot.move.content", tmpOutputDir.getPath(), aptOutputDirectory.getPath())));
success = false;
continue;
}
// we use copyDir instead of moveDirWithContent here, because tmp directory may be located on other disk and
// moveDirWithContent doesn't work for such case
FileUtil.copyDir(tmpOutputDir, aptOutputDirectory);
markDirtyRecursively(aptOutputDirectory, context, ANDROID_APT_COMPILER);
}
storage.update(module.getName(), newState);
@@ -122,11 +122,9 @@ public class AndroidAptCompiler implements SourceGeneratingCompiler {
context.addMessage(CompilerMessageCategory.ERROR, "Cannot create directory " + parent.getPath(), null, -1, -1);
continue;
}
if (!FileUtil.moveDirWithContent(tmpOutputDir, genRootDir)) {
final String message = "Cannot move content from " + tmpOutputDir.getPath() + " to " + genRootPath;
context.addMessage(CompilerMessageCategory.ERROR, message, null, -1, -1);
continue;
}
// we use copyDir instead of moveDirWithContent here, because tmp directory may be located on other disk and
// moveDirWithContent doesn't work for such case
FileUtil.copyDir(tmpOutputDir, genRootDir);
}
results.add(aptItem);
}