summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-12-03 19:20:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-03 19:20:14 +0000
commit3894e76288513a55960baae8dc640f714ac867b5 (patch)
treeeb120321bb086b2795e1de66bd76aaf75f449644
parent05e67ea5f192e61ec5c1958921ecb0fbbbacceec (diff)
parentde04e97e7e0c3fac342302a463935771d2bd5f9c (diff)
downloadidea-3894e76288513a55960baae8dc640f714ac867b5.tar.gz
Merge "81613: Do not delete unmerged handoff SDK" into studio-1.0-release
-rw-r--r--android/src/com/android/tools/idea/welcome/InstallComponentsPath.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/android/src/com/android/tools/idea/welcome/InstallComponentsPath.java b/android/src/com/android/tools/idea/welcome/InstallComponentsPath.java
index b80c68aaf53..28c2e7f441b 100644
--- a/android/src/com/android/tools/idea/welcome/InstallComponentsPath.java
+++ b/android/src/com/android/tools/idea/welcome/InstallComponentsPath.java
@@ -346,6 +346,7 @@ public class InstallComponentsPath extends DynamicWizardPath implements LongRunn
private static class MergeOperation extends InstallOperation<File, File> {
private final File myRepo;
private final InstallContext myContext;
+ private boolean isRepoNoLongerNeeded = false;
public MergeOperation(File repo, InstallContext context, double progressRatio) {
super(context, progressRatio);
@@ -361,8 +362,9 @@ public class InstallComponentsPath extends DynamicWizardPath implements LongRunn
FileUtil.ensureExists(destination);
if (!FileUtil.filesEqual(destination.getCanonicalFile(), myRepo.getCanonicalFile())) {
SdkMerger.mergeSdks(myRepo, destination, indicator);
+ isRepoNoLongerNeeded = true;
}
- myContext.print(String.format("Android SDK was installed to %s", destination), ConsoleViewContentType.SYSTEM_OUTPUT);
+ myContext.print(String.format("Android SDK was installed to %s\n", destination), ConsoleViewContentType.SYSTEM_OUTPUT);
return destination;
}
catch (IOException e) {
@@ -375,7 +377,7 @@ public class InstallComponentsPath extends DynamicWizardPath implements LongRunn
@Override
public void cleanup(@NotNull File result) {
- if (myRepo.exists()) {
+ if (isRepoNoLongerNeeded && myRepo.exists()) {
FileUtil.delete(myRepo);
}
}