Support library gradle improvements

* Define java source compatibility on all build files to avoid
issues that might be caused by compiling with Java8
* Apply the library plugin using the cannonical name
* Define a currentSdkVersion variable instead of embedded string.
We can later load this from a file so that you can checkout
an older branch of support lib and compile it on master and
it won't use master's API by mistake.
This also helps with Android Studio integration.

Bug: 26714403

Change-Id: I0e9f2770b397b761155ac8d4a40fa5fb001264e1
diff --git a/v7/preference/build.gradle b/v7/preference/build.gradle
index a0681ed..45b4f96 100644
--- a/v7/preference/build.gradle
+++ b/v7/preference/build.gradle
@@ -14,7 +14,7 @@
  * limitations under the License
  */
 
-apply plugin: 'android-library'
+apply plugin: 'com.android.library'
 
 archivesBaseName = 'preference-v7'
 
@@ -25,7 +25,7 @@
 }
 
 android {
-    compileSdkVersion 'current'
+    compileSdkVersion project.ext.currentSdk
 
     sourceSets {
         main.manifest.srcFile 'AndroidManifest.xml'