diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/layoutlib/bridge/.classpath | 2 | ||||
| -rw-r--r-- | tools/layoutlib/bridge/Android.mk | 2 | ||||
| -rw-r--r-- | tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java | 41 |
3 files changed, 22 insertions, 23 deletions
diff --git a/tools/layoutlib/bridge/.classpath b/tools/layoutlib/bridge/.classpath index 175a98b..70140d8 100644 --- a/tools/layoutlib/bridge/.classpath +++ b/tools/layoutlib/bridge/.classpath @@ -4,7 +4,7 @@ <classpathentry kind="src" path="tests"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/> + <classpathentry kind="var" path="ANDROID_SRC/prebuilt/common/layoutlib_api/layoutlib_api-prebuilt.jar"/> <classpathentry kind="var" path="ANDROID_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/layoutlib.jar" sourcepath="/ANDROID_SRC/frameworks/base/core/java"/> <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/ninepatch.jar" sourcepath="/ANDROID_SRC/development/tools/ninepatch/src"/> diff --git a/tools/layoutlib/bridge/Android.mk b/tools/layoutlib/bridge/Android.mk index b2010d5..b7a602a 100644 --- a/tools/layoutlib/bridge/Android.mk +++ b/tools/layoutlib/bridge/Android.mk @@ -20,7 +20,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ - layoutlib_api \ + layoutlib_api-prebuilt \ ninepatch LOCAL_STATIC_JAVA_LIBRARIES := temp_layoutlib diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java index 9ad2e6e..7d80796 100644 --- a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java @@ -28,11 +28,8 @@ import org.junit.Before; import org.junit.Test; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.util.TraceClassVisitor; import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -178,24 +175,26 @@ public class DelegateClassAdapterTest { }; cl2.testModifiedInstance(); - } catch (Throwable t) { - // For debugging, dump the bytecode of the class in case of unexpected error. - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - TraceClassVisitor tcv = new TraceClassVisitor(pw); - - ClassReader cr2 = new ClassReader(bytes); - cr2.accept(tcv, 0 /* flags */); - - String msg = "\n" + t.getClass().getCanonicalName(); - if (t.getMessage() != null) { - msg += ": " + t.getMessage(); - } - msg = msg + "\nBytecode dump:\n" + sw.toString(); - - // Re-throw exception with new message - RuntimeException ex = new RuntimeException(msg, t); - throw ex; + // This code block is useful for debugging. However to make it work you need to + // pull in the org.objectweb.asm.util.TraceClassVisitor class and associated + // utilities which are found in the ASM source jar. + // + // } catch (Throwable t) { + // For debugging, dump the bytecode of the class in case of unexpected error. + // StringWriter sw = new StringWriter(); + // PrintWriter pw = new PrintWriter(sw); + // TraceClassVisitor tcv = new TraceClassVisitor(pw); + // ClassReader cr2 = new ClassReader(bytes); + // cr2.accept(tcv, 0 /* flags */); + // String msg = "\n" + t.getClass().getCanonicalName(); + // if (t.getMessage() != null) { + // msg += ": " + t.getMessage(); + // } + // msg = msg + "\nBytecode dump:\n" + sw.toString(); + // // Re-throw exception with new message + // RuntimeException ex = new RuntimeException(msg, t); + // throw ex; + } finally { } } |
