[KeepAnno] Build task for creating keep annotations library.

The keepanno-annotations.jar contains only the client annotations used
for annotating code to be kept. It does not include the AST and
transformation tools intended for shrinkers and/or build systems.

Bug: b/248408342
Change-Id: I4b5ae8b94cf0cce18e4fa9893ac2ad1c403e5870
diff --git a/build.gradle b/build.gradle
index de83e21..a3021ec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -202,6 +202,7 @@
     keepanno {
         java {
             srcDirs = ['src/keepanno/java']
+            include 'com/android/tools/r8/keepanno/annotations/*.java'
         }
     }
 }
@@ -1229,6 +1230,11 @@
     from sourceSets.main.allSource
 }
 
+task keepAnnoJar(type: Jar) {
+    archiveFileName = "keepanno-annotations.jar"
+    from sourceSets.keepanno.output
+}
+
 artifacts {
     archives sourceJar
 }