From: Raphael Date: Fri, 7 Oct 2011 04:41:26 +0000 (-0700) Subject: DDMS plugin: Indicate which missing files prevent it from starting X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7271e996496917492f0e08d8ee1abe3e24ed54cf;p=android-x86%2Fsdk.git DDMS plugin: Indicate which missing files prevent it from starting DDMS plugin checks for 3 files when the tools location is set. If any is missing, it won't connect to ADB. However there is no way to know that exactly. This adds a log with the path of the missing file. Change-Id: If7b679342e6eef314470f63998cdb701e1e1920b --- diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java index 02ca3b0e4..6ed677bef 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java @@ -471,8 +471,22 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL File hprofConverter = new File(hprofConvLocation); File traceview = new File(traceViewLocation); - if (adb.isFile() == false || hprofConverter.isFile() == false || - traceview.isFile() == false) { + String missing = ""; + if (adb.isFile() == false) { + missing += adb.getAbsolutePath() + " "; + } + if (hprofConverter.isFile() == false) { + missing += hprofConverter.getAbsolutePath() + " "; + } + if (traceview.isFile() == false) { + missing += traceview.getAbsolutePath() + " "; + } + + if (missing.length() > 0) { + String msg = String.format("DDMS files not found: %1$s", missing); + Log.e("DDMS", msg); + Status status = new Status(IStatus.ERROR, PLUGIN_ID, msg, null /*exception*/); + getDefault().getLog().log(status); return false; } @@ -734,6 +748,9 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL String dateTag = getMessageTag(tag); stream.print(dateTag); + if (!dateTag.endsWith(" ")) { + stream.print(" "); //$NON-NLS-1$ + } stream.println(message); }