I work on an open source project that is hosted on google code. I'm using ant to create javadocs and I'd like to have links to the source files. I understand I can use the linksource
flag to javadoc to include the source in the resulting html, but this isn't what I really want. What I'd prefer is to provide a link to the source file in google code's 开发者_运维技巧svn browser. I suppose I could do a simple filter prior to running javadoc, but it'd be even better if I could figure a way to do this right in javadoc. Ideally, I could have a property in my ant properties file like
base.src.url=http://code.google.com/p/myproject/source/browse/branches/1.2
and the javadoc command would add a line to each class's html file:
<a href="http://code.google.com/p/myproject/source/browse/branches/1.2/[package]/[classname].html">see source on google code</a>
Any ideas?
The standard doclet offers no such option, as far as I know. So it looks you either have to
- use an alternative doclet,
- patch the standard doclet,
- preprocess the Java files or
- postprocess the produced HTML.
A feature request to include this in the standard doclet might also be a good idea.
精彩评论