Retry: Specify test dependecies in rules.gradle

Now that tests are using Robolectric 3, it should not break the internal
build.

This also updates the android gradle plugin. The block is wrapped in an
if statement, in case someone using plugin version 1.0 includes
rules.gradle.

Change-Id: Ib054e2d39cf1e3bc0746740659f4e5449b2e1375
diff --git a/build.gradle b/build.gradle
index 83acd6d..9f973c1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,12 +19,16 @@
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.2.3'
+        classpath 'com.android.tools.build:gradle:1.3.1'
     }
 }
 
 apply plugin: 'com.android.library'
 
+repositories {
+    jcenter()
+}
+
 android {
     compileSdkVersion 22
     buildToolsVersion = '22.0.1'