-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omit sources from generated Javadoc #7597
Comments
(If we cared enough, I'm sure we could rewrite the links to point to GitHub.) |
@cpovirk may be we can rewrite the links what are your thoughts on this also if we can fix it provide me path to the file. |
The idea would be that the Javadoc for a release (e.g., https://guava.dev/releases/33.4.5-jre/api/docs/com/google/common/annotations/Beta.html) would link not to https://guava.dev/releases/33.4.5-jre/api/docs/src-html/com/google/common/annotations/Beta.html#line-36 but to https://github.com/google/guava/blob/v33.4.5/guava/src/com/google/common/annotations/Beta.java#L36 (and similarly for the Android link, which would go to https://github.com/google/guava/blob/v33.4.5/android/guava/src/com/google/common/annotations/Beta.java#L36). Then the snapshot Javadoc (e.g., https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/annotations/Beta.html) would link not to https://guava.dev/releases/snapshot-jre/api/docs/src-html/com/google/common/annotations/Beta.html#line-36 but to https://github.com/google/guava/blob/master/guava/src/com/google/common/annotations/Beta.java#L36 (and again, a similar variant for Android). The dream would be that we can then wipe out all the (I just ran into trouble with this yesterday when I was trying to perform multiple Guava releases: I ended up with multiple copies of the Guava repo in my |
@cpovirk after checking and rebuilding the project now there is no i need to know more about it like how it can be done
just general question what does the label P3 mean on this issue. |
As I mentioned last week, I filled up my I ran some n=1 experiments to see how slow Guava currently makes various operations:
So I am going to see what I can do about that. Over the weekend, I am going to run:
(Yes, I am aware that As I write this, the contents of #!/bin/bash
set -u
if [[ ! -e releases ]]; then
exit
fi
if [[ -e releases/snapshot-jre/api/docs/com/google/common/util/concurrent/ForwardingBlockingDeque.html && -e javadocshortcuts/forwardingblockingdeque/index.md ]]; then
perl -pi -e 's"collect"util/concurrent"g' javadocshortcuts/forwardingblockingdeque/index.md javadocshortcuts/ForwardingBlockingDeque/index.md
fi
find releases -name src-html | xargs -r rm -r
( cd releases; for R in [0-9]*; do ( cd $R && shopt -s extglob && T=v${R%%?(-jre|-android)} && if [[ $R == *-android ]]; then P=android/; else P=""; fi && case $R in 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | 7.0 | 8.0 | 9.0 ) G="" ;; * ) G=guava/ ;; esac && find -name '*.html' | xargs -r perl -pi -e "s!../../../../src-html/([^#]*)html#line[-.](\d+)!https://github.com/google/guava/blob/$T/${P}${G}src/\${1}java#L\$2!g" ); done )
( for R in releases/[0-9]*; do ( cd $R && for F in $(find api/docs -name '*.html'); do perl -lpi -e 's!^<title>!<link rel="canonical" href="https://guava.dev/releases/snapshot-jre/'$F'"><title>!' $F; done ); done )
if [[ ! -e releases/snapshot ]]; then
exit
fi
find $(find releases/snapshot* -maxdepth 0 -type d) -name '*.html' | xargs -r perl -pi -e 's!<a href="../../../../src-html/[^>]*>(.*?)</a>!$1!g' That will:
|
(I think things are going a little slower than Git projected, perhaps because the size of the files in the branch grows over the life of the repo as we publish more releases? But I had already seen on Friday that "over the weekend" was not going to be enough, so we're probably talking something like the difference between Monday afternoon and Wednesday morning. Anyway, I hope that the results turn out to look as expected, given how slow this is to run :)) |
We're still not there, and at some point tomorrow, my machine will get powered down and moved to my new desk location. We'll see if the rewrite completes in time! (most recently processed: 2024-07-24) When I checked in on the progress, I was reminded of one more annoying bit of our Git history: commits of the following form:
Assuming that I pulled a proper example, that's showing no change to the actual files inside the zip, only the timestamps of those files. (Apparently #6322 doesn't help with that, perhaps because it's telling Maven to touch the resulting files, not telling javac to create everything with the desired timestamps in the first place?) Fortunately, those files went away in b175c48, which was the result of our upgrade to the version of Javadoc from JDK 23, which contains the fix for JDK-8237909. So the problem exists "only" for a number of years back to 2cc42ec / 21d5422, which is when we upgraded our Javadoc version from JDK 8 to JDK 11. If this current rewrite goes well, or even if it doesn't, I may try another round with the goal of eliminating the timestamp changes from the Git history, too. And hmm, is there an opportunity to normalize timestamps from before #6322, too? It looks like no: The timestamp affects only the year. Well it affected more than that back before we added |
Well, it completed in time! I haven't pushed it, nor have I updated it with the commits that landed since the process started.
->
I notice that there's yet more that changes from commit to commit, since JDiff includes its timestamp and the directory name, as shown in ddab7ef. And I'm suspicious of some changes to the actual Javadoc's inherited-methods section. Still, I see some now-empty commits, so that seems like a good sign. (I was expecting to be able to zap all of those with a simple |
When we build Javadoc, we set
linksource
. That causes the Javadoc tool to generate links from text likepublic interface Multimap
in https://guava.dev/Multimap. Those links go to pages like https://guava.dev/releases/snapshot-jre/api/docs/src-html/com/google/common/collect/Multimap.html#line-164.I somewhat suspect that no one cares about these pages: If they want source, they'll look in GitHub or in the source jar for a release or snapshot.
Additionally, these pages force the generated Javadoc to change even for implementation changes (example output changes from input changes).
And any additional page presumably slows down downloading history, switching branches, and deploying the guava.dev. site.
I'm not sure I'll even bother to remove
linksource
, but I'm thinking about it, so let me know if that would cause a problem for you. If I do try it, and if it goes well, I might even consider removing some of the existing sources....The text was updated successfully, but these errors were encountered: