OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 UpdateUtils.unzip( | 285 UpdateUtils.unzip( |
286 updateZip, | 286 updateZip, |
287 tmpDir, | 287 tmpDir, |
288 UpdateJobMessages.InstallUpdateAction_extract_task, | 288 UpdateJobMessages.InstallUpdateAction_extract_task, |
289 mon.newChild(20)); | 289 mon.newChild(20)); |
290 | 290 |
291 monitor.setTaskName(UpdateJobMessages.InstallUpdateAction_preparing_task); | 291 monitor.setTaskName(UpdateJobMessages.InstallUpdateAction_preparing_task); |
292 File sdkDir = new File(installTarget, "dart-sdk"); //$NON-NLS-1$ | 292 File sdkDir = new File(installTarget, "dart-sdk"); //$NON-NLS-1$ |
293 UpdateUtils.deleteDirectory(sdkDir, mon.newChild(4)); | 293 UpdateUtils.deleteDirectory(sdkDir, mon.newChild(4)); |
294 UpdateUtils.deleteDirectory(new File(installTarget, "samples"), mon.newChild
(4)); //$NON-NLS-1$ | 294 UpdateUtils.deleteDirectory(new File(installTarget, "samples"), mon.newChild
(4)); //$NON-NLS-1$ |
295 | 295 // TODO(keertip): check can be removed after all installs are on version wit
h android dir |
| 296 File androidDir = new File(installTarget, "android"); |
| 297 if (androidDir.exists()) { |
| 298 UpdateUtils.deleteDirectory(androidDir, mon.newChild(4)); |
| 299 } |
296 terminateRunningDartLaunches(); | 300 terminateRunningDartLaunches(); |
297 | 301 |
298 File dartium = DartSdkManager.getManager().getSdk().getDartiumWorkingDirecto
ry(installTarget); | 302 File dartium = DartSdkManager.getManager().getSdk().getDartiumWorkingDirecto
ry(installTarget); |
299 try { | 303 try { |
300 UpdateUtils.delete(dartium, mon.newChild(2)); | 304 UpdateUtils.delete(dartium, mon.newChild(2)); |
301 } catch (Throwable th) { | 305 } catch (Throwable th) { |
302 //TODO(pquitslund): handle delete errors | 306 //TODO(pquitslund): handle delete errors |
303 UpdateCore.logError(th); | 307 UpdateCore.logError(th); |
304 } | 308 } |
305 | 309 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 private void terminateRunningDartLaunches() { | 460 private void terminateRunningDartLaunches() { |
457 ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); | 461 ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); |
458 for (ILaunch launch : launchManager.getLaunches()) { | 462 for (ILaunch launch : launchManager.getLaunches()) { |
459 if (!launch.isTerminated() && isDartLaunch(launch) && launch.canTerminate(
)) { | 463 if (!launch.isTerminated() && isDartLaunch(launch) && launch.canTerminate(
)) { |
460 terminate(launch); | 464 terminate(launch); |
461 } | 465 } |
462 } | 466 } |
463 } | 467 } |
464 | 468 |
465 } | 469 } |
OLD | NEW |