Adds working lint target to support lib build, more workarounds

Explicitly disable on v17 leanback and v7 preference, which need
some work. Suppress issues due to Lint failing to distinguish locally-
defined methods from framework methods.

Depends on fullsdk project, which is NOT in the default checkout.

Bug: 29630077
Test: ./gradlew lint && ./gradlew assemble
Change-Id: If8da576a8f9e2a431bc60a473f0c36054818d7c1
diff --git a/build.gradle b/build.gradle
index ab8272a..845c801 100644
--- a/build.gradle
+++ b/build.gradle
@@ -105,6 +105,10 @@
 task(prepareRepo) << {
 }
 
+// lint every library
+task(lint) << {
+}
+
 
 import com.google.common.io.Files
 import com.google.common.base.Charsets
@@ -291,6 +295,11 @@
             // enable code coverage for debug builds only if we are not running inside the IDE
             // enabling coverage reports breaks the method parameter resolution in the IDE debugger
             project.android.buildTypes.debug.testCoverageEnabled = !hasProperty('android.injected.invoked.from.ide')
+
+            // Ensure we run API lint checks.
+            project.android.lintOptions.check 'NewApi'
+            project.android.lintOptions.fatal 'NewApi'
+            project.parent.lint.dependsOn project.lint
         }
 
         // Create release and separate zip task for Android libraries (and android-annotations,