From 3c440e3dc4d259726c6eeca2ed81fe5c53ed7470 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Fri, 25 May 2012 18:43:05 +0400 Subject: [PATCH] use copyDir instead of moveDirWithContent because tmp dir may be on other disk --- .../jps/android/AndroidSourceGeneratingBuilder.java | 9 +++------ .../jetbrains/android/compiler/AndroidAptCompiler.java | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java index de9770c665f8..8f38c85b047b 100644 --- a/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java +++ b/plugins/android/jps-plugin/src/org/jetbrains/jps/android/AndroidSourceGeneratingBuilder.java @@ -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); diff --git a/plugins/android/src/org/jetbrains/android/compiler/AndroidAptCompiler.java b/plugins/android/src/org/jetbrains/android/compiler/AndroidAptCompiler.java index caf9dac270f9..5ce2bfdc5652 100644 --- a/plugins/android/src/org/jetbrains/android/compiler/AndroidAptCompiler.java +++ b/plugins/android/src/org/jetbrains/android/compiler/AndroidAptCompiler.java @@ -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); }