Allow to provide URLs for docs of external classes

Thereby, javadoc can render references to other projects (e.g.: JGit
classes) as proper links.

Change-Id: Ie011121c0aaeef2616d1c7f795cf9b48769ac274
diff --git a/java_doc.bucklet b/java_doc.bucklet
index 57e3367..64b8d87 100644
--- a/java_doc.bucklet
+++ b/java_doc.bucklet
@@ -35,11 +35,13 @@
     deps = [],
     visibility = [],
     do_it_wrong = False,
+    external_docs = [],
   ):
   if do_it_wrong:
     sourcepath = paths
   else:
     sourcepath = ['$SRCDIR/' + n for n in paths]
+  external_docs.insert(0, 'http://docs.oracle.com/javase/7/docs/api')
   genrule(
     name = name,
     cmd = ' '.join([
@@ -51,7 +53,7 @@
       '-charset UTF-8',
       '-notimestamp',
       '-windowtitle "' + title + '"',
-      '-link http://docs.oracle.com/javase/7/docs/api',
+      ' '.join(['-link %s' % url for url in external_docs]),
       '-subpackages ',
       ':'.join(pkgs),
       '-sourcepath ',