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

Dependencies and javadoc #179

Closed
amariottini opened this Issue Feb 5, 2015 · 15 comments

Comments

Projects
None yet
3 participants
@amariottini

amariottini commented Feb 5, 2015

It seems the plugin doesn't download the javadoc of the dependencies (Artifactory accessed as Maven).
Am I missing something?

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 5, 2015

Not very intuitive but you can make the plugin download the javadoc (when you ask it to download dependency sources) by adding this to the build script (of the project whose dependecies' javadoc is to be downloaded):

apply plugin: 'idea'
idea.module.downloadJavadoc = true

EDIT: Still, the plugin will prefer the sources to display the javadoc over the downloaded javadoc (if the sources are available).

@amariottini

This comment has been minimized.

amariottini commented Feb 5, 2015

It works with some dependencies and not with others.
For example I have access to Log4j javadoc but not BouncyCastle or my internal libraries.
Any idea?

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 5, 2015

Can you clarify what exactly did you do (and in what order)? (e.g., clicked "Download sources")

@amariottini

This comment has been minimized.

amariottini commented Feb 6, 2015

Changed build.grade.file
Reloaded the project
Downloaded sources

I discovered that only my libraries miss the javadoc (BouncyCastle is ok, my mistake).
Looking at Artifactory I have the -javadoc.jar files (no sources, I don't put sources into Artifactory).
Any idea?

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 6, 2015

Checking at the sources, it seems I have never implemented javadoc lookup when it is downloaded from a Maven repo (or from whatever into Gradle's cache). If I will have time, I'll add this on the weekend. Though I probably won't have a new release until the Gradle 2.3 problem is fixed.

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 8, 2015

It should now be fixed in master but I have nothing to try this out. It would be great if you could build the plugin from the sources (gradle build should be ok) and try if it works for you.

@amariottini

This comment has been minimized.

amariottini commented Feb 9, 2015

I tried and nothing changed.
I tried even to change JAVADOC_SUFFIX = "-javadoc.jar"; (I have javadoc with .jar extension) in the AutoJavaJavadocForBinaryQuery class but doesn't worked.

How can I debug what's happening?

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 9, 2015

".jar" is not needed, the extension is appended.

To debug the project, you need to define the netBeansExecutable property in ~/.gradle/gradle.properties (it is the executable used to start NetBeans).

Anyway, NetBeans should call GradleCacheJavadocForBinaryQuery.findJavadoc when it is needed (I guess when you are trying to display the javadoc). So for the purpose of javadoc, this method is the entry point.

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 9, 2015

What it supposed to do is: Assumes that the given binary is in the Gradle cache and (based on some assumption) finds the downloaded javadoc file in the cache.

@amariottini

This comment has been minimized.

amariottini commented Feb 9, 2015

If I manually put the -javadoc.zip file in the cache it is loaded.
If the javadoc file ends with .jar it is not loaded.
I think the plugin should look for .zip and .jar files.....

The problem is the javadoc file is not downloaded and saved in cache when I do Download Sources.

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 9, 2015

Strange because if idea.module.downloadJavadoc = true is specified, Gradle should download the javadoc files as well in the particular subproject.

If you put a -javadoc.zip file next to it, it is found by another query which is designed for cases when the dependency is commited to the repo.

Anyway, the javadoc file is not supposed to be in the same dir. It must be in its own directory (named after the sha1 code of the file).

@amariottini

This comment has been minimized.

amariottini commented Feb 10, 2015

I verified the -javadoc.jar files are in the Gradle cache.
They are simply not used....

kelemen added a commit that referenced this issue Feb 10, 2015

@kelemen

This comment has been minimized.

Owner

kelemen commented Feb 10, 2015

I think this issue is now fixed (still, if there are sources, the sources are preferred over javadoc because NB seems to format them nicer).

If you want to build the project from the sources, I recommend cleaning first (because sometimes the Gradle daemon locks some files which will silently not be updated and clean will surely fail if something like this happens). Took me quite a bit of time of wondering why there are misterious method not found errors :).

@amariottini

This comment has been minimized.

amariottini commented Feb 11, 2015

Now it works, thanks.

@WillBDaniels

This comment has been minimized.

WillBDaniels commented Feb 11, 2015

just built this from source, and I can confirm, works awesome. Thanks so much for this! it's great!

@kelemen kelemen added the enhancement label Feb 12, 2015

@kelemen kelemen closed this Feb 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment