code: def create_doc_jar(self, target, open_jar, version):
      
      javadoc = self._java_doc(target)
      scaladoc = self._scala_doc(target)
      if javadoc or scaladoc:
        jar_path = self.artifact_path(open_jar, version, suffix='-javadoc')
        with self.open_jar(jar_path, overwrite=True, compressed=True) as open_jar:
          def add_docs(docs):
            if docs:
              for basedir, doc_files in docs.items():
                for doc_file in doc_files:
                  open_jar.write(os.path.join(basedir, doc_file), doc_file)
  
          add_docs(javadoc)
          add_docs(scaladoc)
        return jar_path
      else:
        return None
docs: Returns a doc jar if either scala or java docs are available for the given target.