Add SdkUiLib tests to adt-tests.

Also fixes the create_tests_symlink for Windows.

SDK BUG 2040986

Change-Id: I7d549c265efb9dbb5936ed7c9a7798eefee52d9b
diff --git a/tools/eclipse/plugins/.gitignore b/tools/eclipse/plugins/.gitignore
index 076f284..72cc8c5 100644
--- a/tools/eclipse/plugins/.gitignore
+++ b/tools/eclipse/plugins/.gitignore
@@ -54,5 +54,6 @@
 com.android.ide.eclipse.tests/kxml2-2.3.0.jar
 com.android.ide.eclipse.tests/unittests/com/android/ddmlib
 com.android.ide.eclipse.tests/unittests/com/android/sdklib
+com.android.ide.eclipse.tests/unittests/com/android/sdkuilib
 com.android.ide.eclipse.tests/unittests/com/android/layoutlib
 
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/.classpath b/tools/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
index e0778f4..1209191 100644
--- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
@@ -5,6 +5,7 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="lib" path="/adt/sdklib.jar" sourcepath="/SdkLib"/>
+	<classpathentry kind="lib" path="/adt/sdkuilib.jar" sourcepath="/SdkUiLib"/>
 	<classpathentry kind="lib" path="/adt/layoutlib_api.jar" sourcepath="/layoutlib_api"/>
 	<classpathentry kind="lib" path="/adt/ninepatch.jar"/>
 	<classpathentry kind="lib" path="layoutlib.jar"/>
diff --git a/tools/eclipse/scripts/create_test_symlinks.sh b/tools/eclipse/scripts/create_test_symlinks.sh
index 3305062..5c12542 100755
--- a/tools/eclipse/scripts/create_test_symlinks.sh
+++ b/tools/eclipse/scripts/create_test_symlinks.sh
@@ -15,6 +15,7 @@
 if [ "${HOST:0:6}" == "CYGWIN" ]; then
     # We can't use symlinks under Cygwin
     function cpdir() { # $1=dest $2=source
+        echo "rsync $2 => $1"
         rsync -avW --delete-after $2 $1
     }
 
@@ -32,17 +33,31 @@
 HOST=`uname`
 if [ "$HOST" == "Linux" ]; then
     ln -svf $BACK/out/host/linux-x86/framework/kxml2-2.3.0.jar "$DEST/"
-    ln -svf $BACK/out/host/linux-x86/framework/layoutlib.jar "$DEST/"
+    ln -svf $BACK/out/host/linux-x86/framework/layoutlib.jar   "$DEST/"
+
 elif [ "$HOST" == "Darwin" ]; then
     ln -svf $BACK/out/host/darwin-x86/framework/kxml2-2.3.0.jar "$DEST/"
-    ln -svf $BACK/out/host/darwin-x86/framework/layoutlib.jar "$DEST/"
+    ln -svf $BACK/out/host/darwin-x86/framework/layoutlib.jar   "$DEST/"
 
 elif [ "${HOST:0:6}" == "CYGWIN" ]; then
     if [ ! -f "$DEST/kxml2-2.3.0.jar" ]; then
         cp -v "prebuilt/common/kxml2/kxml2-2.3.0.jar" "$DEST/"
     fi
 
-    cp -v "$BACK/out/host/windows/framework/layoutlib.jar" "$DEST/"
+    LIBS="layoutlib.jar sdkuilib.jar"
+    NEED_MAKE="yes"
+    for LIB in $LIBS ; do
+        SRCJAR="out/host/windows-x86/framework/$LIB"
+        DSTJAR="$DEST/$LIB"
+        if [[ $NEED_MAKE ]] && ! diff -q "$SRCJAR" "$DSTJAR" >/dev/null ; then
+            MAKE_LIBS="${LIBS//.jar/}"
+            echo "Make java libs: $MAKE_LIBS"
+            make -j3 showcommands $MAKE_LIBS || die "adt-tests: Failed to build one of $LIBS."
+            NEED_MAKE=""
+        fi
+        
+        cp -v "$SRCJAR" "$DSTJAR"
+    done
 
     chmod -v a+rx "$DEST"/*.jar
 else
@@ -53,6 +68,7 @@
 DEST=$BASE/unittests/com/android
 cpdir $DEST development/tools/ddms/libs/ddmlib/tests/src/com/android/ddmlib
 cpdir $DEST development/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib
+cpdir $DEST development/tools/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib
 
 DEST=$BASE/unittests/com/android/layoutlib
 mkdir -p $DEST