Adding tests for rotation preference
Updating the gradle file to run tests directly from AndroidStudio

Change-Id: Iac23dfc6f995477f2406071fbfab3a16ee58ce6f
diff --git a/build.gradle b/build.gradle
index d971755..44f5b7c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@
         mavenCentral()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.0'
+        classpath 'com.android.tools.build:gradle:+'
         classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
     }
 }
@@ -21,6 +21,9 @@
         targetSdkVersion 23
         versionCode 1
         versionName "1.0"
+
+        testApplicationId "com.android.launcher3.tests"
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         debug {
@@ -30,10 +33,16 @@
     sourceSets {
         main {
             res.srcDirs = ['res', 'WallpaperPicker/res']
-            main.java.srcDirs = ['src', 'WallpaperPicker/src']
+            java.srcDirs = ['src', 'WallpaperPicker/src']
             manifest.srcFile 'AndroidManifest.xml'
             proto.srcDirs 'protos/'
         }
+
+        androidTest {
+            java.srcDirs = ['tests/src']
+            res.srcDirs = ['tests/res']
+            manifest.srcFile "tests/AndroidManifest.xml"
+        }
     }
 }
 
@@ -42,9 +51,13 @@
 }
 
 dependencies {
-    compile 'com.android.support:support-v4:+'
-    compile 'com.android.support:recyclerview-v7:+'
+    compile 'com.android.support:support-v4:23.0.1'
+    compile 'com.android.support:recyclerview-v7:23.0.1'
     compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
+
+    testCompile 'junit:junit:4.12'
+    androidTestCompile 'com.android.support.test:runner:+'
+    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:+'
 }
 
 protobuf {