aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/app
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2011-04-27 22:34:52 -0700
committerRaphael Moll <ralf@android.com>2011-04-27 22:56:36 -0700
commit2054803497f94b7c3d6e1933d89d9bc88740ea07 (patch)
treeaa195a76f48c690e3b2d68b5da15406696f7d44a /ddms/app
parent9d333439029e282e9b8fec93e57ebedeb5c4016a (diff)
downloadsdk-2054803497f94b7c3d6e1933d89d9bc88740ea07.zip
sdk-2054803497f94b7c3d6e1933d89d9bc88740ea07.tar.gz
sdk-2054803497f94b7c3d6e1933d89d9bc88740ea07.tar.bz2
Add missing OSGI jar to DDMS classpath.
DDMS requires an osgi.jar, which is correctly declared in the manifest. It is however not declared in the classpath used by Eclipse. The consequence is that trying to use the pref panel when running ddms from eclipse crashes with with a ClassNotFound exception. Change-Id: I204232a608be0da584577d13f5649d03bb542976
Diffstat (limited to 'ddms/app')
-rw-r--r--ddms/app/.classpath2
-rw-r--r--ddms/app/README78
-rw-r--r--ddms/app/src/com/android/ddms/PrefsDialog.java6
3 files changed, 78 insertions, 8 deletions
diff --git a/ddms/app/.classpath b/ddms/app/.classpath
index 3f01de4..6caf176 100644
--- a/ddms/app/.classpath
+++ b/ddms/app/.classpath
@@ -3,9 +3,11 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ANDROID_SWT"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ANDROID_OSGI"/>
<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
<classpathentry combineaccessrules="false" kind="src" path="/AndroidPrefs"/>
<classpathentry combineaccessrules="false" kind="src" path="/SdkStatsService"/>
+ <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/ddms/app/README b/ddms/app/README
index cc55ddd..3b7df9c 100644
--- a/ddms/app/README
+++ b/ddms/app/README
@@ -1,11 +1,75 @@
-Using the Eclipse projects for ddms.
+Using the Eclipse project DDMS
+------------------------------
-ddms requires SWT to compile.
+DDMS requires some external libraries to compile.
+If you build DDMS using the makefile, you have nothing to configure.
+However if you want to develop on DDMS using Eclipse, you need to
+perform the following configuration.
-SWT is available in the depot under //device/prebuild/<platform>/swt
-Because the build path cannot contain relative path that are not inside the project directory,
-the .classpath file references a user library called ANDROID_SWT.
+-------
+1- Projects required in Eclipse
+-------
-In order to compile the project, make a user library called ANDROID_SWT containing the jar
-available at //device/prebuild/<platform>/swt. \ No newline at end of file
+To run DDMS from Eclipse, you need to import the following 5 projects:
+
+ - sdk/androidpprefs: project AndroidPrefs
+ - sdk/sdkstats: project SdkStatsService
+ - sdk/ddms/app: project Ddms
+ - sdk/ddms/libs/ddmlib: project Ddmlib
+ - sdk/ddms/libs/ddmuilib: project Ddmuilib
+
+
+-------
+2- DDMS requires some SWT and OSGI JARs to compile.
+-------
+
+SWT is available in the tree under prebuild/<platform>/swt
+
+Because the build path cannot contain relative path that are not inside
+the project directory, the .classpath file references a user library
+called ANDROID_SWT.
+SWT depends on OSGI, so we'll also create an ANDROID_OSGI library for that.
+
+In order to compile the project:
+- Open Preferences > Java > Build Path > User Libraries
+
+- Create a new user library named ANDROID_SWT
+- Add the following 4 JAR files:
+
+ - prebuild/<platform>/swt/swt.jar
+ - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar
+ - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar
+ - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar
+
+- Create a new user library named ANDROID_OSGI
+- Add the following JAR file:
+
+ - prebuilt/common/osgi/osgi.jar
+
+
+-------
+3- DDMS also requires the compiled SwtMenuBar library.
+-------
+
+Build the swtmenubar library:
+$ cd $TOP (top of Android tree)
+$ . build/envsetup.sh && lunch sdk-eng
+$ sdk/eclipse/scripts/create_sdkman_symlinks.sh
+
+Define a classpath variable in Eclipse:
+- Open Preferences > Java > Build Path > Classpath Variables
+- Create a new classpath variable named ANDROID_OUT_FRAMEWORK
+- Set its folder value to <Android tree>/out/host/<platform>/framework
+- Create a new classpath variable named ANDROID_SRC
+- Set its folder value to <Android tree>
+
+You might need to clean the ddms project (Project > Clean...) after
+you add the new classpath variable, otherwise previous errors might not
+go away automatically.
+
+The ANDROID_SRC part should be optional. It allows you to have access to
+the SwtMenuBar generic parts from the Java editor.
+
+--
+EOF
diff --git a/ddms/app/src/com/android/ddms/PrefsDialog.java b/ddms/app/src/com/android/ddms/PrefsDialog.java
index 418b8ba..c957a89 100644
--- a/ddms/app/src/com/android/ddms/PrefsDialog.java
+++ b/ddms/app/src/com/android/ddms/PrefsDialog.java
@@ -294,7 +294,11 @@ public final class PrefsDialog {
dlg.setPreferenceStore(mPrefStore);
// run it
- dlg.open();
+ try {
+ dlg.open();
+ } catch (Throwable t) {
+ Log.e("ddms", t);
+ }
// save prefs
try {