Author: Kai-Chung Yan
Last-Update: 2016-07-22
Description: Set Class-Paths
 Class-Paths are generated by Gradle and stored in
 /usr/share/doc/{package}/{program}.classpaths for use in launcher scripts.
 This patch makes the upstream scripts use those Class-Paths.
--- a/misc/screenshot2/etc/screenshot2
+++ b/misc/screenshot2/etc/screenshot2
@@ -69,6 +69,9 @@
     jarpath="$frameworkdir/$jarfile"
 fi
 
+classpath="`cat /usr/share/android-platform-tools-base/screenshot2.classpath`:$jarpath"
+mainclass=com.android.screenshot.Screenshot
+
 # need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
 # might need more memory, e.g. -Xmx128M
-exec java -Xmx128M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir" -Djava.library.path="$libdir" -Dcom.android.screenshot.bindir="$progdir" -jar "$jarpath" "$@"
+exec java -Xmx128M $os_opts $java_debug -Dcom.android.screenshot.bindir="$progdir" -classpath "$classpath" "$mainclass" "$@"
--- a/lint/cli/etc/lint
+++ b/lint/cli/etc/lint
@@ -65,9 +65,11 @@
 
 jarpath="$frameworkdir/$jarfile"
 
+classpaths=`cat /usr/share/android-platform-tools-base/lint.classpath`:$jarpath
+
 exec "$javaCmd" \
     -Xmx1024m $os_opts $java_debug \
     -Dcom.android.tools.lint.bindir="$progdir" \
     -Djava.awt.headless=true \
-    -classpath "$jarpath" \
+    -classpath "$classpaths" \
     com.android.tools.lint.Main "$@"
