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); }