Allow Java libraries to export and propagate proguard_specs.

It may be the case that a library used by Java clients is also used
by Android clients, but when used for the latter, it requires a particular
Proguard configuration. This change modifies Java library rules to accept
Proguard specs and pass them up to Android rules.

Note that this does not cause Proguard to be used on normal Java binaries.

RELNOTES[NEW]: java_library now supports the proguard_specs attribute for
passing Proguard configuration up to Android (not Java) binaries.

--
MOS_MIGRATED_REVID=104661799
diff --git a/tools/jdk/BUILD b/tools/jdk/BUILD
index 3326081..b8f0419 100644
--- a/tools/jdk/BUILD
+++ b/tools/jdk/BUILD
@@ -103,10 +103,34 @@
 
 filegroup(
     name = "srcs",
-    srcs = ["BUILD"],  # Tools are build from the workspace for tests.
+    srcs = [
+        "BUILD",  # Tools are build from the workspace for tests.
+        "proguard_whitelister.py",
+        "proguard_whitelister_test.py",
+        "proguard_whitelister_test_input.cfg",
+    ],
 )
 
 filegroup(
     name = "package-srcs",
     srcs = glob(["**"]),
 )
+
+py_binary(
+    name = "proguard_whitelister",
+    srcs = [
+        "proguard_whitelister.py",
+    ],
+    deps = [
+        "//third_party/py/gflags",
+    ],
+)
+
+py_test(
+    name = "proguard_whitelister_test",
+    srcs = ["proguard_whitelister_test.py"],
+    data = ["proguard_whitelister_test_input.cfg"],
+    deps = [
+        ":proguard_whitelister",
+    ],
+)