Annotate other support library tests

- Added NO_DOCS files to other test folders
- All test APKs are copied (if they have tests) via
  ./gradlew assembleAndroidTest

I've left leanback out since they have a odd test project
hierarchy, and they'd probably need TV devices on the CI
server anyway.

BUG: 24494874

Change-Id: Iff25af777438e62f30b63843d89325d380cf7e1e
diff --git a/build.gradle b/build.gradle
index 8e89705..45d9901 100644
--- a/build.gradle
+++ b/build.gradle
@@ -118,7 +118,6 @@
 createSourceProp.dependsOn unzipRepo
 prepareRepo.dependsOn createSourceProp
 
-
 import com.google.common.hash.HashCode
 import com.google.common.hash.HashFunction
 import com.google.common.hash.Hashing
@@ -169,6 +168,23 @@
             project.android.buildToolsVersion = rootProject.buildToolsVersion
         }
     }
+
+    // Copy instrumentation test APK into the dist dir
+    project.afterEvaluate {
+        def assembleTestTask = project.tasks.findByPath('assembleAndroidTest')
+        if (assembleTestTask != null) {
+            assembleTestTask.doLast {
+                // If the project actually has some instrumentation tests, copy its APK
+                if (!project.android.sourceSets.androidTest.java.sourceFiles.isEmpty()) {
+                    def pkgTask = project.tasks.findByPath('packageDebugAndroidTest')
+                    copy {
+                        from(pkgTask.outputFile)
+                        into(rootProject.ext.testApkDistOut)
+                    }
+                }
+            }
+        }
+    }
 }
 
 project.gradle.buildFinished { buildResult ->